R vector values in data area
1 answer
You can save the list as part of a dataframe, which is one way to have vector-valued entries. For example:
m <- data.frame(a=1:10)
m$l <- lapply(1:10, function(x) c(x, x + 1))
m$l
As an example of how this is actually used in R, a POSIXlt
date is actually a list with components giving year, month, day, etc. When you store a date variable like this in a data frame, what is stored is a list of vectors.
+7
source to share