Vidyalelo
R Programming · all questions

Control Structures in R Programming
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

207

Questions

7/11

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following R code snippet?
> paste("a", "b", se = ":")

Select an option to see the answer and solution.

CRAN package ecosystem has more than . . . . . . . . packages.

Select an option to see the answer and solution.

. . . . . . . . function will measure the probability of the binary response variable in R language.

Select an option to see the answer and solution.

Point out the correct statement?

Select an option to see the answer and solution.

How missing values and impossible values are represented in R language?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- list(a = 1:4, b = rnorm(10), c = rnorm(20, 1), d = rnorm(100, 5))
> lapply(x, mean)

Select an option to see the answer and solution.

The . . . . . . . . function takes a vector or other objects and splits it into groups determined by a factor or list of factors.

Select an option to see the answer and solution.

The . . . . . . . . function is used to plot negative likelihood.

Select an option to see the answer and solution.

lappy functions takes . . . . . . . . arguments in R language.

Select an option to see the answer and solution.

Which function is more verbose?

Select an option to see the answer and solution.

Which function calculates the count of each category of a categorical variable?

Select an option to see the answer and solution.

. . . . . . . . applies a function over the margins of an array.

Select an option to see the answer and solution.

The syntax of the for loop is?

Select an option to see the answer and solution.

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)

Select an option to see the answer and solution.

. . . . . . . . require you to pass a function whose argument is a vector of parameters.

Select an option to see the answer and solution.

Which of the following is valid syntax for if else statement in R?

Options are not available for this question.

Select an option to see the answer and solution.

What will be the class of the vector if you concatenate a number and NA?

Select an option to see the answer and solution.

What will be the output of the following R code snippet?
> f <- function(a, b) {
+       a^2
+ }
> f(2)

Select an option to see the answer and solution.

. . . . . . . . function is preferred over sapply as vapply allows the programmer to specific the output type.

Select an option to see the answer and solution.

The line of code in R language should begin with a . . . . . . . .

Select an option to see the answer and solution.