# NOT RUN {
test1 <- list( c(a='a',b='b',c='c'), c(a='d',b='e',c='f'))
as.data.frame(test1)
test2 <- list( c('a','b','c'), c(a='d',b='e',c='f'))
as.data.frame(test2)
test3 <- list('Row1'=c(a='a',b='b',c='c'), 'Row2'=c(var1='d',var2='e',var3='f'))
as.data.frame(test3)
# }
# NOT RUN {
#This will print a warning.
test4 <- list('Row1'=letters[1:5], 'Row2'=letters[1:7], 'Row3'=letters[8:14])
as.data.frame(test4)
# }
# NOT RUN {
test5 <- list(letters[1:10], letters[11:20])
as.data.frame(test5)
# }
# NOT RUN {
#This will throw an error.
test6 <- list(list(letters), letters)
as.data.frame(test6)
# }
Run the code above in your browser using DataLab