Introduction to lists

What is the code to regenerate dataframe mydf without using data.frame()?

## structure(list(a = c("x", "y", "z"), b = 1:3), class = "data.frame", row.names = c(NA, 
## -3L))
  • A data frame is just a list of vectors (the ‘columns’) which has been attributed the ‘data.frame’ class!
  • It has methods defined in base R, e.g. defining how to print a data.frame using print(); see methods(class = "data.frame").