Displaying 2 results from an estimated 2 matches for "gor10".
Did you mean:
or10
2017 Aug 23
4
Flummoxed by gsub().
...that appear at
the end of the strings in "x".
My reading of ?regex led me to believe that
gsub("[:alpha:]","",x)
should give the result that I want. However it returns
[1] "mung5" "mung10" "mung20" "gor5" "gor10" "gor20"
i.e. it chops the last letter out of the "gorp" string, but nothing else.
I am completely bewildered by this behaviour and can see no rationale
for it nor any way to adjust my syntax to get what I want.
A bit of Googling led me to the information that
gs...
2017 Aug 23
0
Flummoxed by gsub().
...gs in "x".
>
> My reading of ?regex led me to believe that
>
> gsub("[:alpha:]","",x)
>
> should give the result that I want. However it returns
>
> [1] "mung5" "mung10" "mung20" "gor5" "gor10" "gor20"
>
> i.e. it chops the last letter out of the "gorp" string, but nothing else.
>
> I am completely bewildered by this behaviour and can see no rationale for it
> nor any way to adjust my syntax to get what I want.
>
> A bit of Googling led me t...