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

4/7

Page

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

Multiple objects can be de parsed at once and read back using function . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- as.Date("2012-03-01")
> y <- as.Date("2012-02-28")
> x-y

Select an option to see the answer and solution.

Which of the following opens connection to gz-compressed text file?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- list(foo = 1:4, bar = 0.6)
> x

Select an option to see the answer and solution.

The . . . . . . . . function can be used to select columns of a data frame that you want to focus on.

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))
> x[[c(1, 3)]]

Select an option to see the answer and solution.

What will be the output of the following R code?
> p <- as.POSIXlt(x)
> names(unclass(p))
> p$wday

Select an option to see the answer and solution.

There is an SQL interface for relational databases via the . . . . . . . . package.

Select an option to see the answer and solution.

dput() output is in the form of . . . . . . . .

Select an option to see the answer and solution.

Unlike writing out a table or CSV file, dump() and dput() preserve the . . . . . . . . so that another user doesn't have to specify the all over again.

Select an option to see the answer and solution.

Which of the following code would read 100 rows?

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 code opens a connection to the file foo.txt, reads from it, and closes the connection when its done?

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 <- c(1, 2, NA, 4, NA, 5)
> bad <- is.na(x)
> print(bad)

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 statement will load the objects to the file named "mydata.RData"?

Select an option to see the answer and solution.

. . . . . . . . opens a connection to a file compressed with gzip.

Select an option to see the answer and solution.

What will be the output of the following R code?
> y <- data.frame(a = 1, b = "a")
> dput(y)

Select an option to see the answer and solution.

Which of the following is example of vectorized operation as far as subtraction is concerned?
> x <- 1:4
> y <- 6:9

Select an option to see the answer and solution.