I have a list returned by sapply()
$my.list <- sapply()
$my.list
"var1" "var2" "var3"
1.1 2.5 3.2
The ideal result is to transform my.list into a data frame df:
$df
"var1" 1.1
"var2" 2.5
"var3" 3.2
I have tried to 'subset' each row of my.list as follows:
$p1 <- names(my.list)
$p1
"var1" "var2" "var3"
$p2 <- as.vector(my.list)
$p2
1.1 2.5 3.2
But then I had no further luck cbind/rbind-ing these row vectors into a data frame. Any thoughts/suggestions? Thanks.
I am not sure whether this is what you require.
I'm sure there might be some other smart ways to do it !