> x <- scan("clipboard", what="")
Read 7 items
> x
[1] "1.11" "10.11" "11.11" "113.31" "114.2" "114.3" "114.8"
> gsub("[0-9]*\\.", "", x)
[1] "11" "11" "11" "31" "2" "3" "8"
>
Bernd Weiss wrote:
> Dear all,
>
> I am struggling with the use of regular expression. I got
>
>
>>as.character(test$sample.id)
>
> [1] "1.11" "10.11" "11.11" "113.31" "114.2" "114.3" "114.8"
>
> and need
>
> [1] "11" "11" "11" "31" "2" "3" "8"
>
> I.e. remove everything before the "." .
>
> TIA,
>
> Bernd
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html