R Programming Quiz Questions and Answers 18

This post is about “R Programming Quiz Questions and Answers”. There are 20 multiple-choice type questions from R programming covering topics related to the output of different R commands, R console, matrices, data frames, factors, vectors, R objects, and different operations on R objects. Let us start with R Programming Quiz Questions and Answers.

Online Multiple Choice Questions about R Programming Language

1. What would be the output of the following code?
x <- 1:4
y <- 6:9
z <- x + y
print(z)

 
 
 
 

2. The multiplication of two matrices $A$ and $B$ can be performed in R using the operator

 
 
 
 

3. What is the output of 1:4 + 4:1

 
 
 
 

4. What will be the output of the following
x <- vector("numeric", length = 10); print(x)

 
 
 
 

5. When we compare two vectors element by element the resultant outcome is a

 
 
 
 

6. Which command will create a matrix of the first 9 numbers in 3 rows and 3 columns?

 
 
 
 

7. What would be the output of 1:5 + 5:1.

 
 
 
 

8. The output of the seq(1, 10, 2) is

 
 
 
 

9. R console is a tool that is used to write (insert) standard

 
 
 
 

10. What is the data type of vector $a$ if a <- c(1, “m”, FALSE)

 
 
 
 

11. The following command will find the 60th percentile for the variable $disp$

 
 
 
 

12. The Vectors, data frames, or matrices containing decimal values can be converted to integers using

 
 
 
 

13. In R, object name cannot start with

 
 
 
 

14. Which of the following function can be used to create a vector having repeated values

 
 
 
 

15. What will be the output of the following
X <- factor(c(“yes”, “yes”, “yes”, “no”, “yes”, “no”, “no”)
table(X)

 
 
 
 

16. The output of seq(10, 1, -2) is

 
 
 
 

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

 
 
 
 

18. All columns in a matrix must have the

 
 
 
 

19. What will be the output of the following code
X <- factor(c("m", "m", "m", "f", "m", "f", "f")
table(X)

 
 
 
 

20. What will be the output of the following lines of code?
x <- 31
if (x %% 2 == 0){
print("X is even")
}else {
print("X is odd")
}

 
 
 
 

R FAQS R Programming Quiz Questions and Answers

R Programming Quiz Questions and Answers

  • The output of seq(10, 1, -2) is
  • What will be the output of the following lines of code? x <- 31 if (x %% 2 == 0){ print(“X is even”) }else { print(“X is odd”) }
  • What would be the output of 1:5 + 5:1.
  • What will be the output of the following x <- vector(“numeric”, length = 10); print(x)
  • What would be the output of the following code? x <- 1:4 y <- 6:9 z <- x + y print(z)
  • What will be the output of the following X <- factor(c(“yes”, “yes”, “yes”, “no”, “yes”, “no”, “no”) table(X)
  • The output of the seq(1, 10, 2) is
  • What will be the output of the following code X <- factor(c(“m”, “m”, “m”, “f”, “m”, “f”, “f”) table(X)
  • What is the output of 1:4 + 4:1
  • R console is a tool that is used to write (insert) standard
  • The following command will find the 60th percentile for the variable $disp$
  • The multiplication of two matrices $A$ and $B$ can be performed in R using the operator
  • Which command will create a matrix of the first 9 numbers in 3 rows and 3 columns?
  • When we compare two vectors element by element the resultant outcome is a
  • Which of the following function can be used to create a vector having repeated values
  • The Vectors, data frames, or matrices containing decimal values can be converted to integers using
  • What is the data type of vector $a$ if a <- c(1, “m”, FALSE)
  • All columns in a matrix must have the
  • To perform one-way Analysis of variance, one can use function
  • In R, object name cannot start with
R Programming Quiz Questions and Answers

https://itfeature.com, https://gmstat.com

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