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

2/7

Page

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

How do you extract the first row of a data frame named my_data in R?

Select an option to see the answer and solution.

In R, what is the purpose of the table() function?

Select an option to see the answer and solution.

How do you remove a column named Income from a data frame named my_data in R?

Select an option to see the answer and solution.

In R, what does the unlist() function do?

Select an option to see the answer and solution.

How is a character string converted to a numeric vector in R using the as.numeric() function?

Select an option to see the answer and solution.

In R, what is the purpose of the subset() function?

Select an option to see the answer and solution.

How do you add a new row to a data frame named my_data with values "Alice" and 28 for columns Name and Age?

Select an option to see the answer and solution.

What function is used to concatenate two vectors in R?

Select an option to see the answer and solution.

In R, what does the slice() function do?

Select an option to see the answer and solution.

How do you create a named numeric vector with values 1, 2, and 3 named "one", "two", and "three" in R?

Select an option to see the answer and solution.

Which of the following code represents internal representation of a Date object?

Select an option to see the 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, ]

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

The . . . . . . . . function is used to generate summary statistics from the data frame within strata defined by a variable.

Select an option to see the answer and solution.

Main way to read the data back in (parsing it) using the function.

Select an option to see the answer and solution.

If we want to save individual R objects to a file, we use the . . . . . . . . function.

Select an option to see the answer and solution.

load() is used for . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- 1:4
> y <- 6:9
> z <- x + y
> z

Select an option to see the answer and solution.

Which of the following extracts first element from the following R list?
> x <- list(foo = 1:4, bar = 0.6)

Select an option to see the answer and solution.