I am trying to write a data frame to csv, but it seems to be complaining because the columns contain lists.
I want to be able to access this data frame and call it in R later. I donβt care how to do it (save as a text file, etc.). This is a fairly large data set n = 182305. Any ideas to write it to a file that I can read pretty quickly in R (I'm not married to a csv file)
DATA Frame and the code I tried
DF2<-structure(list(word = c("3-D", "4-F", "4-H'er", "4-H", "A battery", "a bon march"), pos.code = c("AN", "N", "N", "A", "h", "v"), pos = list(c("A", "N"), "N", "N", "A", "h", "v"), noun = list( TRUE, TRUE, TRUE, FALSE, FALSE, FALSE), plural = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), noun.phrase = list( FALSE, FALSE, FALSE, FALSE, TRUE, FALSE), verb.usually.participle = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), transitive.verb = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), intransitive.verb = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), adjective = list( TRUE, FALSE, FALSE, TRUE, FALSE, FALSE), adverb = list( FALSE, FALSE, FALSE, FALSE, FALSE, TRUE), conjunction = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), preposition = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), interjection = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), pronoun = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), definite.article = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), indefinite.article = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), nominative = list( FALSE, FALSE, FALSE, FALSE, FALSE, FALSE)), .Names = c("word", "pos.code", "pos", "noun", "plural", "noun.phrase", "verb.usually.participle", "transitive.verb", "intransitive.verb", "adjective", "adverb", "conjunction", "preposition", "interjection", "pronoun", "definite.article", "indefinite.article", "nominative"), row.names = c(NA, 6L), class = "data.frame") write.table(DF2, file = "mobyPOS.csv", sep = " ", col.names = TRUE,qmethod = "double")
The error message I received is:
> write.table(DF2, file = "mobyPOS.csv", sep = " ", col.names = TRUE,qmethod = "double") Error in write.table(x, file, nrow(x), p, rnames, sep, eol, na, dec, as.integer(quote), : unimplemented type 'list' in 'EncodeElement'