[R] Word Frequency for each row
Tyler Rinker
tyler_rinker at hotmail.com
Sat Mar 9 23:23:46 CET 2013
I see you provided sample data. Here it is with that:
library(qdap)
termco(dat$Data, dat$ID, c(" oranges "))
----------------------------------------
> From: tyler_rinker at hotmail.com
> To: sudipanalyst at gmail.com; r-help at r-project.org
> Date: Sat, 9 Mar 2013 17:20:24 -0500
> Subject: Re: [R] Word Frequency for each row
>
>
> I think the qdap package's termco (termo count) function will do what you want. Read the specifics as spacing around the word matters.
>
>
>
> library(qdap);
> termco(DATA$state, 1:nrow(DATA), c("it"))
>
>
>
>
> ----------------------------------------
> > Date: Fri, 8 Mar 2013 21:34:31 +0530
> > From: sudipanalyst at gmail.com
> > To: r-help at r-project.org
> > Subject: [R] Word Frequency for each row
> >
> > Hi All,
> >
> > I am wondering if there is any examples where you can count your
> > interested "word" in each row. For an example if you have data with *'ID*'
> > and '*write-up*' for 100 rows, how would I calculate the word frequency for
> > each row ?
> >
> > Thank you for all your time.
> >
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list