Re: [R] count number of stop words in R

2017-06-12 Thread Bert Gunter
Health Analytics, Data Science, Big Data Expert & Independent Consultant > C: 954.614.1178 > > > > From: R-help on behalf of Bert Gunter > > Sent: Monday, June 12, 2017 10:12:33 AM > To: Elahe chalabi > Cc: R-help Mailing List &g

Re: [R] count number of stop words in R

2017-06-12 Thread Florian Schwendinger
lt;- DocumentTermMatrix(corp, cntrl) col_sums(dtm[, which(colnames(dtm) %in% stopwords("en"))]) Best, Florian   Gesendet: Montag, 12. Juni 2017 um 16:12 Uhr Von: "Bert Gunter" An: "Elahe chalabi" Cc: "R-help Mailing List" Betreff: Re: [R] count numbe

Re: [R] count number of stop words in R

2017-06-12 Thread Patrick Casimir
nday, June 12, 2017 11:42:43 AM To: Patrick Casimir; Bert Gunter Cc: R-help Mailing List Subject: Re: [R] count number of stop words in R Defining data as you mentioned in your respond causes the following error: Error in UseMethod("tm_map", x) : no applicable method for 'tm_map

Re: [R] count number of stop words in R

2017-06-12 Thread Patrick Casimir
List Subject: Re: [R] count number of stop words in R Defining data as you mentioned in your respond causes the following error: Error in UseMethod("tm_map", x) : no applicable method for 'tm_map' applied to an object of class "character" I can solve this error by us

Re: [R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
June 12, 2017 11:23:42 AM To: Patrick Casimir; Bert Gunter Cc: R-help Mailing List Subject: Re: [R] count number of stop words in R Thanks for your reply. I know the command data <- tm_map(data, removeWords, stopwords("english")) removes English stop words, I don't know how sho

Re: [R] count number of stop words in R

2017-06-12 Thread Patrick Casimir
rick Casimir, PhD Health Analytics, Data Science, Big Data Expert & Independent Consultant C: 954.614.1178 From: Elahe chalabi Sent: Monday, June 12, 2017 11:23:42 AM To: Patrick Casimir; Bert Gunter Cc: R-help Mailing List Subject: Re: [R] count number o

Re: [R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
lish")) Patrick Casimir, PhD Health Analytics, Data Science, Big Data Expert & Independent Consultant C: 954.614.1178 From: R-help on behalf of Bert Gunter Sent: Monday, June 12, 2017 10:12:33 AM To: Elahe chalabi Cc: R-help Mailing List Subject:

Re: [R] count number of stop words in R

2017-06-12 Thread Patrick Casimir
er Sent: Monday, June 12, 2017 10:12:33 AM To: Elahe chalabi Cc: R-help Mailing List Subject: Re: [R] count number of stop words in R You can use regular expressions. ?regex and/or the stringr package are good places to start. Of course, you have to define "stop words." Cheers, Bert

Re: [R] count number of stop words in R

2017-06-12 Thread Bert Gunter
You can use regular expressions. ?regex and/or the stringr package are good places to start. Of course, you have to define "stop words." Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathe

[R] count number of stop words in R

2017-06-12 Thread Elahe chalabi via R-help
Hi all, Is there a way in R to count the number of stop words (English) of a string using tm package? str="Mhm . Alright . There's um a young boy that's getting a cookie jar . And it he's uh in bad shape because uh the thing is falling over . And in the picture the mother is washing dishes and