[R] Error in using tokens script

Jianjun Wang jw@ng @end|ng |rom c@ub@edu
Tue May 28 18:51:02 CEST 2019


Hi, Colleagues.

As shown at the bottom, I was able to obtain information from a column (named "Message") of a text data (named "SMSSpamCollection" (i.e., SMSSpamCollection$Message[44]).  But when I ran
SMSSpamCollection.token <-tokens(SMSSpamCollection$Message, what="word",
+                                  remove_url = TRUE,
+                                  remove_numbers= TRUE, remove_punct= TRUE,
+                                  remove_symbols= TRUE, remove_hyphens= TRUE)
The feedback was
Error in tokens.default(SMSSpamCollection$Message, what = "word", remove_url = TRUE,  :
  tokens() only works on character, corpus, tokens objects.

I would appreciate some guidance to fix the error message!

Thank you.

JJ

> SMSSpamCollection$Message[44]
[1] Great! I hope you like your man well endowed. I am  <#>  inches...
3026 Levels: 'An Amazing Quote'' - Sometimes in life its difficult to decide whats wrong!! a lie that brings a smile or the truth that brings a tear.... ...

	[[alternative HTML version deleted]]



More information about the R-help mailing list