[R] How to create a data.frame with a unknow number of columns ?
- by Olivier
Hello
I would like to create, in a function, a boucle to create a data.frame with a variable number of columns.
WIth something like :
a = c("a","b")
b = c(list(1,2,3), list(4,5,6))
data.frame(a,b)
I would like to get a data-frame like :
a 1 2 3
b 4 5 6
Instead of I obtain :
a 1 2 3 4 5 6
b 1 2 3 4 5 6
Thank you !
PS : I also try with rbind, but it's doesn't work...