R: How to fix a namespace error?

I want to use NGramTokenizerfrom RWeka, but for some reason I get this error: I need the following function

BigramTokenizer <- function(x) NGramTokenizer(x, Weka_control(min = 2, max = 2))
bigramWords.dtm <- DocumentTermMatrix(Corpus(VectorSource(SentenceVector)), control = list(tokenize = BigramTokenizer))

So, I installed RWeka:

package ‘RWekajars’ successfully unpacked and MD5 sums checked
package ‘RWeka’ successfully unpacked and MD5 sums checked

But:

> library(RWeka)
Error : package ‘methods’ does not have a namespace
Error: package or namespace load failed for ‘RWeka’

I also get namespace errors installing packages such as:

install.packages("dplyr")
Installing package into ‘C:/Users/SomeUser/Documents/R/win-library/3.0
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘methods’ is not available
also installing the dependencies ‘assertthat’, ‘BH’
+3
source share

All Articles