[R] how to subtract one string from another in R
djmuser at gmail.com
Sat Jun 18 12:24:52 CEST 2011
Is this what you're looking for?
string <- "ABC DEFG HIJKLM NOPQ RSTUV WXY"
unlist(strsplit(string, " "))
 "ABC" "DEFG" "HIJKLM" "NOPQ" "RSTUV" "WXY"
On Sat, Jun 18, 2011 at 1:36 AM, Vijayan Padmanabhan
<padmanabhan.vijayan at gmail.com> wrote:
> Dear R Group
> Here is what i am trying to do.. but couldnt figure out how..
> string<-"ABC DEFG HIJKLM NOPQ RSTUV WXY"
> I want to create an R object string 2 ( following the logic shown).. R does
> not allow string subtraction.. any suggestions how to achieve this?
> string2<-string-string1 (it should now hold "DEFG HIJKLM NOPQ RSTUV WXY"
> I want to loop this till i reach the end of the original string..
> Any help would be appreciated.
> Vijayan Padmanabhan
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help