[R] removing entries from a character vector

Sarah Goslee sarah.goslee at gmail.com
Wed Jul 22 03:40:01 CEST 2015


See ?grepl

If you'd like a more detailed answer, here are some suggestions for
creating a good reproducible example:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Sarah


On Tue, Jul 21, 2015 at 4:00 PM, thok12 <tk9830 at gmail.com> wrote:
> ok this is a textbook question but i feel kind of lost so any help would be
> appreciated.
>
> I have a character vector with couple of hundreds of observations
>
> about 60 of them are in the following fashion
> "total June15"
> "total July 15"
> "total July 17"
> etc.
>
> now I want to remove these entries but not one by one.
> I want to write some code that will remove all the entries with the
> word/string "total" in them.
> I tried few things but with no success.
>
> thanks in advance
>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list