Hi all.
this code
require(tm)
require(quanteda)
df <- data.frame(c(1, 2), c("f", "s"))
# df <- data.frame(c(1), c("f"))
names(df) <- c("id", "value")
map <- list(id = "id", content = "value")
reader <- readTabular(mapping = map)
crp <- VCorpus(DataframeSource(df), readerControl = list(reader = reader))
corpus(crp)
gives no error.
however for uncommented line df <- data.frame(c(1), c("f")) it gives following error:
"Error in as.data.frame.matrix(do.call(rbind, (lapply(x$content, "[[", :
row names must be 'character' or 'integer', not 'logical'"
i'm quite new to R but as i understand the reason is row.names = FALSE in
as.data.frame(do.call(rbind, (lapply(x$content, "[[", "meta"))),
stringsAsFactors = FALSE, row.names = FALSE)
call in 'corpus.R'.
packageVersion("tm") -> '0.6.2'
packageVersion("quanteda") -> '0.9.8.5'
packageVersion("base") -> '3.3.2'
Hi all.
this code
gives no error.
however for uncommented line
df <- data.frame(c(1), c("f"))it gives following error:"Error in as.data.frame.matrix(do.call(rbind, (lapply(x$content, "[[", :
row names must be 'character' or 'integer', not 'logical'"
i'm quite new to R but as i understand the reason is
row.names = FALSEincall in 'corpus.R'.
packageVersion("tm") -> '0.6.2'
packageVersion("quanteda") -> '0.9.8.5'
packageVersion("base") -> '3.3.2'