R Programming Quiz 19

The Quiz is about R Programming Quiz with Answers. There are 20 multiple-choice questions covering different topics related to R Language Programming. Let us start with the R Programming Quiz now.

Online R Programming Quiz with Answers

Please enter your email:

1. All columns in a matrix must have the

 
 
 
 

2. For a matrix $X$ of order $n\times p$ and a vector $Y$ of order $n\times 1$, one can find regression coefficients using

 
 
 
 

3. In R, what is the result of the function as.integer(3.3)?

 
 
 
 

4. In R, which command should you use to insert a new row into a data frame?

 
 
 
 

5. Which command in R would return the following character vector? “Imdad” “Usman” “Ali” “Amir”

 
 
 
 

6. Assume that the function add is defined as follows:

add <- function(x,y) {
(x + y)
return (x - y)
temp <<- (x * y)
return (x / y)
}

What will be the output if you issue the command add(10,5)?

 
 
 
 

7. After installing and calling the httr library in R, which method should you use to update a resource?

 
 
 
 

8. In R, which command will output the data from the Nile built-in data set?

 
 
 
 

9. In R, assume you have a vector named “age,” and each element in the vector is the age of one person in a group. The vector has the following content: 24 32 46 19. What will be the result if you issue the age[-2] command?

 
 
 
 

10. In R, what is the result of the function as.numeric(TRUE)?

 
 
 
 

11. In R, variables are typically assigned using <-, but they can also be assigned using which of the following symbols?

 
 
 
 

12. In R, assume you have a vector named “age,” and each element in the vector is the age of one person in a group. Which command must you use to reorder the ages from youngest to oldest?

 
 
 
 

13. In R, which command removes a variable from memory?

 
 
 
 

14. Assume the array books_array contains 6 elements. The array has three rows and two columns and appears as follows:

     [,1]              [,2]
[1,] "It"              "Dr. Sleep"
[2,] "Misery"          "Carrie"
[3,] "The Shining"     "The Mist"

Which of the following commands will return “The Shining”?

 
 
 
 

15. How many elements will be in vector $b$, if b <- 10:15

 
 
 
 

16. What is the first step you must take before you can read an Excel spreadsheet in R?

 
 
 
 

17. What is the main reason for using the R language?

 
 
 
 

18. In R language, which command returns the last six elements of a data object such as a data frame?

 
 
 
 

19. To perform a one-way Analysis of variance, one can use a function

 
 
 
 

20. In R, assume a character vector called “names” has the following contents:

“Harry” “Jimmy” “Tammy”

Which command would return the following logical vector?

FALSE TRUE FALSE

 
 
 
 

Online R Programming Quiz with Answers

  • What is the main reason for using the R language?
  • In R, what is the result of the function as.numeric(TRUE)?
  • In R, variables are typically assigned using <-, but they can also be assigned using which of the following symbols?
  • Which command in R would return the following character vector? “Imdad” “Usman” “Ali” “Amir”
  • In R, assume you have a vector named “age,” and each element in the vector is the age of one person in a group. The vector has the following content: 24 32 46 19. What will be the result if you issue the age[-2] command?
  • Assume the array books_array contains 6 elements. The array has three rows and two columns and appears as follows:

    [,1]              [,2]
[1,] “It”              “Dr. Sleep”
[2,] “Misery”          “Carrie”
[3,] “The Shining”   “The Mist”

Which of the following commands will return “The Shining”?

  • In R language, which command returns the last six elements of a data object such as a data frame?
  • Assume that the function add is defined as follows:
    add <- function(x,y) {
    (x + y)
    return (x – y)
    temp <<- (x * y)
    return (x / y)
    }
    What will be the output if you issue the command add(10,5)?
  • What is the first step you must take before you can read an Excel spreadsheet in R?
  • After installing and calling the httr library in R, which method should you use to update a resource?
  • In R, what is the result of the function as.integer(3.3)?
  • In R, which command removes a variable from memory?
  • In R, assume a character vector called “names” has the following contents: “Harry” “Jimmy” “Tammy” Which command would return the following logical vector? FALSE TRUE FALSE
  • In R, assume you have a vector named “age,” and each element in the vector is the age of one person in a group. Which command must you use to reorder the ages from youngest to oldest?
  • In R, which command will output the data from the Nile built-in data set?
  • In R, which command should you use to insert a new row into a data frame?
  • To perform a one-way Analysis of variance, one can use a function
  • How many elements will be in vector $b$, if b <- 10:15
  • All columns in a matrix must have the
  • For a matrix $X$ of order $n\times p$ and a vector $Y$ of order $n\times 1$, one can find regression coefficients using
R Programming Quiz with Answrs

Statistics and Data Analysis

Online Quiz and Test Website

Leave a Reply

Discover more from R Language Frequently Asked Questions

Subscribe now to keep reading and get access to the full archive.

Continue reading