51. . . . . . . . . loop over a list and evaluate a function on each element.
52. Point out the correct statement?
53. Point out the correct statement?
54. What will be the output of the following R code?
> printmessage <- function(x) {
+ if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(NA)
> printmessage <- function(x) {
+ if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage(NA)
55. Point out the wrong statement?
56. What is the command used to store R objects in a file?
57. Which of the following R code will print "Neither"?
58. . . . . . . . . function generates "n" normal random numbers based on the mean and standard deviation arguments passed to the function.
59. What will be the output of the following R code?
> x <- list(a = matrix(1:4, 2, 2), b = matrix(1:6, 3, 2))
> lapply(x, function(elt) { elt[,1] })
> x <- list(a = matrix(1:4, 2, 2), b = matrix(1:6, 3, 2))
> lapply(x, function(elt) { elt[,1] })
60. . . . . . . . . is the easiest method for reshaping the data before analysis.
Read More Section(Control Structures in R Programming)
Each Section contains maximum 100 MCQs question on Control Structures in R Programming. To get more questions visit other sections.