[R] find similar words in text

Bert Gunter bgunter.4567 at gmail.com
Mon Jul 31 23:38:55 CEST 2017


**Before** posting:

1. Search: e.g. "text processing R"

2. Check CRAN Task views:
e.g. "Natural Language Processing"
https://cran.r-project.org/web/views/NaturalLanguageProcessing.html

3. Use R's search facility:  e.g. help.search("character") which would
lead you to ?grep among others, which might suggest something like

grep("whal",strsplit(yourtext, split = " ", fixed = TRUE), fixed = TRUE)

... although this is likely too simple minded for a text as large as
Moby Dick. But it depends on what you want to do.

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 Breathed in his "Bloom County" comic strip )


On Mon, Jul 31, 2017 at 1:47 PM, Riaan Van Der Walt
<Riaan.VanDerWalt at nwu.ac.za> wrote:
> I am new to R.
> Busy with Text Analysis.
>
> Need a script to find e.g
>
> whale, whales, whale's, whaler, whalers, whaling,... in Moby Dick
>
> Riaan
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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