adplus-dvertising
frame-decoration

Question

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

a.

structure(list(a = 1, b = list(1L, .Label = "a", class = "factor")), .Names= c("a",
"b"), row.names = c(NA, -1L), class = "data.frame")

b.

list(list(a = 1, b = list(1L, .Label = "a", class = "factor")), .Names= c("a",
"b"), row.names = c(NA, -1L), class = "data.frame")

c.

structure(list(a = 1, b = structure(1L, .Label = "a", class = "factor")), .Names= c("a",
"b"), row.names = c(NA, -1L), class = "data.frame")

d.

Error

Answer: (c).structure(list(a = 1, b = structure(1L, .Label = "a", class = "factor")), .Names= c("a",
"b"), row.names = c(NA, -1L), class = "data.frame")

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following R code?

Similar Questions

Discover Related MCQs

Q. 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.

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

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

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

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

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

Q. We can dump() R objects to a file by passing _____

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

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

Q. .rda extension used when saving data with function __________

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

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

Q. 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.

Q. load() is used for _______

Q. readlines is used for ____________

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

Q. Point out the correct statement?

Q. Which of the following statement will load the objects to the file named “mydata.RData”?

Q. Point out the wrong statement?

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