1
I’m running a lexical analysis with a pretty large database. Since there are many terms, R says that there is no vector memory to form the matrix with each of the terms and their respective frequency.
Since I can’t export frequencies of all terms, I’d like to identify the frequency of just a few words in the corpus. How can I do that? I tried that way and it didn’t work:
casos = tm_map(corpus, grep, pattern = "||<termo"
sum(unlist(casos))
The error that appears is as follows:
'invalid type (Character) of argument.
Thank you!
Welcome to Sopt. Try using reprex to reproduce your problem. Without a reproducible example it is difficult to help you
– Tomás Barcellos
The code you put above has a problem. "It seems" (not knowing what you want to do) that a close function call
)
, after"||termo"
. And thatsum...
would be another line.– Tomás Barcellos
What class of
unlist(casos)
and of cases? It seems to be the case that you are applying an operation on a Character that cannot be performed with this type of data. Probably in thesum
or in theunlist
is that mistake– Jorge Mendes