31. Which function calculates the count of each category of a categorical variable?
32. . . . . . . . . applies a function over the margins of an array.
33. The syntax of the for loop is?
34. What will be the output of the following R code?
> printmessage2 <- function(x) {
+ if(is.na(x))
+ print("x is a missing value!")
+ else if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage2(NA)
> printmessage2 <- function(x) {
+ if(is.na(x))
+ print("x is a missing value!")
+ else if(x > 0)
+ print("x is greater than zero")
+ else
+ print("x is less than or equal to zero")
+ invisible(x)
+ }
> printmessage2(NA)
35. . . . . . . . . require you to pass a function whose argument is a vector of parameters.
36. Which of the following is valid syntax for if else statement in R?
37. What will be the class of the vector if you concatenate a number and NA?
38. What will be the output of the following R code snippet?
> f <- function(a, b) {
+ a^2
+ }
> f(2)
> f <- function(a, b) {
+ a^2
+ }
> f(2)
39. . . . . . . . . function is preferred over sapply as vapply allows the programmer to specific the output type.
40. The line of code in R language should begin with a . . . . . . . .
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.