Re: [R] R does not subset

2013-05-07 Thread John Field
This typically occurs because of sloppy manual data entry outside of R. To relieve further analysis pain, you can manually clean the data (usually only effective for one-time analyses) or use R to fix problems right after loading the data (there are multiple methods for doing this... I prefer usin

Re: [R] R does not subset

2013-05-03 Thread Mihai Nica
>>Since I lost a morning too with this issue, I am just curious, why is >>there a space?� >> >>I know, it must be a dumb question, a reasonable programming rule, but >>that's my level :-) >>� >>mike >> >> >>>___

Re: [R] R does not subset

2013-05-03 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Katarzyna Kulma > Sent: Friday, May 03, 2013 4:21 AM > To: David Kulp > Cc: r-help@r-project.org > Subject: Re: [R] R does not subset > > Jorge, thank

Re: [R] R does not subset

2013-05-03 Thread Jeff Newmiller
ming rule, but >that's my level :-) >� >mike > > >> >> From: Jorge I Velez >>To:Katarzyna Kulma >>Cc: R mailing list >>Sent: Friday, May 3, 2013 6:01 AM >>Subject: Re: [R] R does not subset >> >> >>Hi Kasia, >> >>You

Re: [R] R does not subset

2013-05-03 Thread Mihai Nica
__ > From: Jorge I Velez >To:Katarzyna Kulma >Cc: R mailing list >Sent: Friday, May 3, 2013 6:01 AM >Subject: Re: [R] R does not subset > > >Hi Kasia, > >You need > >subset(REC2,  INFECTION=="Infected ") > >(note the space after "Infected&quo

Re: [R] R does not subset

2013-05-03 Thread Katarzyna Kulma
Jorge, thanks for your suggestions, but they give the same (empty) result: > RECinf<-subset(REC2, INFECTION=="Infected") > head(RECinf) [1] RINGNOyear ccFLEDGE rec2012 binageINFECTION all.rsLD <0 rows> (or 0-length row.names) but David's suggestion worked! : > RECinf<-REC2[REC2$

Re: [R] R does not subset

2013-05-03 Thread Jorge I Velez
Hi Kasia, You need subset(REC2, INFECTION=="Infected ") (note the space after "Infected"). HTH, Jorge.- On Fri, May 3, 2013 at 7:48 PM, Katarzyna Kulma wrote: > Hi everyone, > > I know there have been several requests regarding subsetting before, but > none of them really helps with my prob

Re: [R] R does not subset

2013-05-03 Thread Katarzyna Kulma
Hi Luis, thanks for the suggestion, but still nothing: > RECinf2<-subset(REC2, INFECTION==1) > head(RECinf2) [1] RINGNOyear ccFLEDGE rec2012 binageINFECTION all.rsLD <0 rows> (or 0-length row.names) cheers, Kasia Katarzyna Kulma PhD Student Department of Ecology and Genetics

Re: [R] R does not subset

2013-05-03 Thread Luis Iván Ortiz Valencia
$ INFECTION: Factor w/ 2 levels "Infected ","Uninfected ": 2 1 2 1 2 2 1 2 it is a factor variable, so it takes numeric values, for "Infected " it is assigned value 1. subset(REC2, INFECTION==1) 2013/5/3 Jorge I Velez > Hi Kasia, > > You need > > subset(REC2, INFECTION=="Infected ") > > (n

Re: [R] R does not subset

2013-05-03 Thread David Kulp
You have an extra space in the INFECTION factors. Use REC2[REC2$INFECTION=="Infected ",] or subset(REC2, INFECTION=="Infected ") No need to use which here. On May 3, 2013, at 5:48 AM, Katarzyna Kulma wrote: > Hi everyone, > > I know there have been several requests regarding subsetting before,

[R] R does not subset

2013-05-03 Thread Katarzyna Kulma
Hi everyone, I know there have been several requests regarding subsetting before, but none of them really helps with my problem: I'm trying to subset only infected individuals from the REC2 data.frame: > str(REC2) 'data.frame':362 obs. of 7 variables: $ RINGNO : Factor w/ 370 levels "BL1