Skip to content
Prev 150070 / 398500 Next

Convert data set to data frame

On Mon, 2008-07-14 at 14:40 -0700, Willa Wei wrote:
Hi Willa,
If you only have one level of breakdown, the result will be a matrix,
but you will have to remove the class:

my.new.breakdown<-as.data.frame(unclass(t(my.old.breakdown)))

For multilevel breakdowns, you will have to create a function like:

brkdn2tdf<-function(x) return(as.data.frame(unclass(t(x))))

and then use rapply to step through the list.

Jim