Re: [R] problem with comparing a part of string with whole string

2009-02-20 Thread Daniel Malter
ebruary 20, 2009 1:20 AM An: Petr PIKAL Cc: r-help@r-project.org Betreff: Re: [R] problem with comparing a part of string with whole string Hi , i just attached one file to this mail which contains one modal of my data and there i have to search for the rows which contains "SPECIMENTYP %in%

Re: [R] problem with comparing a part of string with whole string

2009-02-19 Thread venkata kirankumar
Hi , i just attached one file to this mail which contains one modal of my data and there i have to search for the rows which contains "SPECIMENTYP %in% "ADIPOSE TISSUE"" and the rows which contains " "PRESERVED"in ORGCHARRES for that i tried with " r<-subset(rr,SPECIMENTYP %in% "ADIPOSE

Re: [R] problem with comparing a part of string with whole string

2009-02-19 Thread jim holtman
'grep' will tell you if there is a match in the string; > x <- c("*RIGHT, EPICARDIUM: FOCUS, GRAY-WHITE, SINGLE, APPROX 0.6 CM IN > DIAMETER*.","*MEDULLRY TUMOR BENIGN,TYP PHEOCHROMOCYTOMA*") > grep("GRAY-WHITE", x) [1] 1 > grep("TUMOR BENIGN", x) [1] 2 On Thu, Feb 19, 2009 at 7:39 AM, venkata k

[R] problem with comparing a part of string with whole string

2009-02-19 Thread venkata kirankumar
Hi all, I got one problem with comparing strings like if any string is like "*RIGHT, EPICARDIUM: FOCUS, GRAY-WHITE, SINGLE, APPROX 0.6 CM IN DIAMETER*." and i have to compare "*GRAY-WHITE*"with the above string or otherwise i have to compare " *TUMOR BENIGN*" this st