[R] how to exclude certain keywords in strings

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Oct 12 07:26:01 CEST 2018

I cannot imagine you looked very hard... this kind of question pops up all the time on this mailing list. Read the help fur the sub() function... you want to search for something and replace it with an empty string ("").

You should also know by now to post plain text on this mailing list.

On October 11, 2018 8:59:11 PM PDT, lily li <chocold12 using gmail.com> wrote:
>Hi R users,
>I don't know how to extract certain words in strings. For example, if I
>have strings like the formats "StationName1_temp.csv",
>"StationName2_temp.csv", etc. How to get strings like these
>"StationName2", etc? That is to say, I want to exclude the keywords
>"_temp.csv", but I could not find a clue online. Thanks for your help.
>	[[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Sent from my phone. Please excuse my brevity.

More information about the R-help mailing list