[R] how to exclude certain keywords in strings

lily li choco|d12 @end|ng |rom gm@||@com
Fri Oct 12 06:03:40 CEST 2018


I just figured this out, which seems to be a simple question. I just used
gsub("_temp.csv","","StationName1_temp.csv").



> 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 "StationName1",
> "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]]




More information about the R-help mailing list