[R] problem with comparing a part of string with whole string
jholtman at gmail.com
Thu Feb 19 13:53:56 CET 2009
'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)
> grep("TUMOR BENIGN", x)
On Thu, Feb 19, 2009 at 7:39 AM, venkata kirankumar
<kiran4u2all at gmail.com> wrote:
> 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
> "*MEDULLRY TUMOR BENIGN,TYP PHEOCHROMOCYTOMA*"
> i tried with split and compare but its not working
> can any one suggest how can i compare these type of Strings
> thanks in advance
> [[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.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help