Vidyalelo
R Programming · all questions

Data Structures in R Programming
practice.

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

122

Questions

5/7

Page

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

Point out the wrong statement?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- matrix(1:6, 2, 3)
> x[1, 2]

Select an option to see the answer and solution.

Individual R objects can be saved to a file using the . . . . . . . . function.

Select an option to see the answer and solution.

Point out the correct statement?

Select an option to see the answer and solution.

If you have a lot of objects that you want to save to a file, we use . . . . . . . . function.

Select an option to see the answer and solution.

Multiple objects can be de parsed at once using the . . . . . . . . function.

Select an option to see the answer and solution.

When you call serialize() on an R object, the output will be . . . . . . . . coded in hexadecimal format.

Select an option to see the answer and solution.

Which of the following code extracts 1st element of the 2nd element?
> x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))

Select an option to see the answer and solution.

Which of the following object is masked from 'package: stats'?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- list(aardvark = 1:5)
> x[["a", exact = FALSE]]

Select an option to see the answer and solution.

Point out the wrong statement?

Select an option to see the answer and solution.

One way to pass data around is by de parsing the R object with . . . . . . . .

Select an option to see the answer and solution.

.RData extension used when we save data using the functions . . . . . . . .

Select an option to see the answer and solution.

Which of the following extracts first element from the following R vector?
> x <- c("a", "b", "c", "c", "d", "a")

Select an option to see the answer and solution.

Point out the correct statement?

Select an option to see the answer and solution.

Which of the following R statement will save the output to the file for following R code?
> a <- data.frame(x = rnorm(100), y = runif(100))
> b <- c(3, 4.4, 1 / 3)

Select an option to see the answer and solution.

The benefit of the . . . . . . . . function is that it is the only way to perfectly repressed an R object in an exportable format, without losing precision or any metadata.

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- as.Date("2012-01-01")
> y <- strptime("9 Jan 2011 11:34:21", "%d %b %Y %H:%M:%S")
> x-y

Select an option to see the answer and solution.

Which of the following return a subset of the columns of a data frame?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- c("a", "b", "c", "c", "d", "a")
> x[c(1, 3, 4)]

Select an option to see the answer and solution.