Is it possible to create a tibble
or data.frame
, which has columns that are integers and other columns that are tibbles
or data.frames
?
E.g.:
library(tibble)
set.seed(1)
df.1 <- tibble(name=sample(LETTERS,20,replace = F),score=sample(1:100,20,replace = F))
df.2 <- tibble(name=sample(LETTERS,20,replace = F),score=sample(1:100,20,replace = F))
And then:
df <- tibble(id=1,rank=2,data=df.1)
which gives this error
:
Error: Column `data` must be a 1d atomic vector or a list
I guess df.1
has to be a list
for this to work?