As outlined here dataframes can have lists as columns. I try to do the same in Rcpp but without success.
df = data.frame(a=seq(1,2))
df$b = list(seq(1,10), seq(11,20))
df
My corresponding Rcpp example converts the resulting dataframe to a list (i.e. drops the dataframe attribute) - unintentionally:
cppFunction('
DataFrame testme() {
DataFrame df = DataFrame::create(Named("a") = seq(1, 2));
df["b"] = List::create(seq(1,10), seq(11,20));
return df;
}')
testme()
Any ideas?