renozao / NMF

NMF: A Flexible R package for Nonnegative Matrix Factorization
139 stars 41 forks source link

Can't seem to make nmf work in R, I keep getting a method error. #165

Open Mikaelsauriol5 opened 3 years ago

Mikaelsauriol5 commented 3 years ago

library(NMF) textes <- tm_map(textes, stripWhitespace) textes <- tm_map(textes, tolower) textes <- tm_map(textes, removePunctuation) textes <- tm_map(textes, removeNumbers) textes <- tm_map(textes, removeWords, stopwords("english"))

tdm <- TermDocumentMatrix(textes)

P <- nmf(tdm, rank=2) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘nmf’ for signature ‘"TermDocumentMatrix", "numeric", "missing"’

I've seen people use nmf like this, i'm not sure why it isn't working for me.