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

2009-02-20 Thread Daniel Malter
Imagine the following data of noises that people make, and you want to know who makes the noise blub. data=data.frame(rbind(c(blah, boo, blub),c(blabber, baeh, blib),c(quack, cheer, blub))) names(data)=c(noises) data searchTerm=blub #The first gives a list of all noises that people make #who

[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 string

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 kirankumar

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 PRESERVEDin ORGCHARRES for that i tried with r-subset(rr,SPECIMENTYP %in% ADIPOSE TISSUE