My plan is to work on a corpus of data in R, using the Quanteda package. I'm using the poliblogs.csv database accessible from here, with the script below. In the past, the script worked smoothly, but now an error message appears. The errors happen when I try to get the stats of the corpus or when I try to trim it.
The script I run is the following:
require("quanteda")
require("readtext")
require("topicmodels")
require("stm")
blog.dat <- readtext("poliblogs2008.csv",
textfield="documents")
meta.list <- list(blog=blog.dat$blog,
day=blog.dat$day,
rating= blog.dat$rating)
names(meta.list)
blogcorpus <- corpus(blog.dat,
meta=meta.list)
meta <- meta(blogcorpus)
mycorpus.stats <- summary(blogcorpus)
blog.dfm <- dfm(blogcorpus, remove=stopwords("english"),
stem= TRUE,
removePunct= TRUE)
The errors appear when I run the lines:
mycorpus.stats <- summary(blogcorpus)
and
blog.dfm <- dfm(blogcorpus, remove=stopwords("english"),
stem= TRUE,
removePunct= TRUE)
In both cases, the following same error message appears:
Error in if (...length() && any(...names() == "Dimnames")) .Object@Dimnames <- fixupDN(.Object@Dimnames) :
missing value where TRUE/FALSE needed
The same error appears with a multiplicity of datasets, so it doesn't seem to be data-dependent.
UPDATE: Actually, the problem was caused by a bug that occurred to RStudio itself. Uninstalling and re-installing R and RStudio solved the issue and made the error disappear. Thanks to everyone who looked and provided a solution.