[R] Subsetting for unwanted values

2010-06-03 Thread LCOG1
Hi all, I have toyed with this for too long today and in the past i used multiple lines of code to get at what i want. Consider the following: All i need to do is subset Pc to the values that do not equal Pc.X. The first attempt doesnt work because i have unequal lengths. The second

Re: [R] Subsetting for unwanted values

2010-06-03 Thread Joris Meys
PcToAdd_-Pc[!(Pc %in% Pc.X)] PcToAdd_ [1] Res Os Gov Rur PcToAdd_-subset(Pc,!(Pc %in% Pc.X)) PcToAdd_ [1] Res Os Gov Rur On Fri, Jun 4, 2010 at 1:52 AM, LCOG1 jr...@lcog.org wrote: Hi all,   I have toyed with this for too long today and in the past i used multiple lines of code to

Re: [R] Subsetting for unwanted values

2010-06-03 Thread Jorge Ivan Velez
Check ?%in% HTH, Jorge On Thu, Jun 3, 2010 at 7:52 PM, LCOG1 wrote: Hi all, I have toyed with this for too long today and in the past i used multiple lines of code to get at what i want. Consider the following: All i need to do is subset Pc to the values that do not equal Pc.X. The