[R] Error when attempting to see "Corpus" metadata

Jeff Reichman reichmanj at sbcglobal.net
Tue Nov 7 23:40:38 CET 2017


R Project

 

I receive the erro highlighted in yellow when attempting to combine two
Corpus, so I'm assuming I'm not combining the two variables (nb_pos and
nb_neg) in the following line

 

nb_all <- c(nb_pos,nb_neg,recursive=TRUE) # anyone see anything wrong with
this line of code

 

--------------------------------------------------

 

> library("tm")

Loading required package: NLP

> nb_pos <- Corpus(DirSource(path_to_pos_folder), readerControl =
list(language="en")) # appears to be correct

> nb_neg <- Corpus(DirSource(path_to_neg_folder), readerControl =
list(language="en")) # appears to be correct       

> nb_all <- c(nb_pos,nb_neg,recursive=TRUE)

> 

> meta(nb_all[[1]])

Error in UseMethod("meta", x) : 

  no applicable method for 'meta' applied to an object of class "character"

 

Jeff Reichman


	[[alternative HTML version deleted]]



More information about the R-help mailing list