Examveda

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: Option C


This Question Belongs to R Programming >> Data Structures In R Programming

Join The Discussion

Related Questions on Data Structures in R Programming