r - To create a list manually is not equivalent to mget() when saving via write.xls() -
r - To create a list manually is not equivalent to mget() when saving via write.xls() -
edited (heavily):
why work, , makes write.xls
save info frames separate worksheets...
vec1 = iris vec2 = mtcars library(dataframes2xls) write.xls(c(vec1, vec2), file = "df.xls")
... not? , how circumvent necessity write manually list of objects want have saved write.xls
?
dflist = mget( ls( pattern = "vec" ) ) write.xls(dflist, file = "df.xls") error in data.frame(list(sepal.length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4, : arguments imply differing number of rows: 150, 32
that function doesn't seem take named lists (which odd). coerced mget
phone call info frame , worked on end. maybe give shot
> write.xls(mget(ls(pattern = "vec")), "list1.xls") # error in get(s[i]) : object 'mget(ls(pattern="vec"' not found > as.df <- as.data.frame(mget(ls(pattern = "vec"))) > write.xls(as.df, "list1.xls") > list.files(pattern = "list") # [1] "list1.xls"
r list object
Comments
Post a Comment