r - How to interpret error in write(mydata, "mydata.csv")? "List" cannot be handeled by "cat"? -
seems ran similar problem, here. however, jacob's question (from 2 years ago) still unanswered. , also, context there little different mine:
so trying export dataframe .csv file works fine. time, however, ran following error message:
write(mydata, "mydata.csv") #error message: error in cat(x, file = file, sep = c(rep.int(sep, ncolumns - 1), "\n"), : argument 1 (type 'list') cannot handled 'cat'
now won't copy , paste head(mydata)
returns, because dataframe relatively big. there seems nothing wrong data , variables, can work with them normally. thing cannot export them .csv file (or other format).
help?*
*probably stupid , have overlooked something...
chi pak's comment above right. address problem of saving data frame csv, use write.csv
instead of write
.
to address question, error message arose because write
totally different breed of animal write.csv
. if read file ?write
, described wrapper concatenate function cat
, expects data written out in form of atomic vector (or resulting names()
).
a dataframe's type list
, can verify typeof(mydata)
. not atomic vector & cause write
return error experienced.
Comments
Post a Comment