[R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
I am trying to create a new datafarme using the subset function given 2 conditions subset1- subset(dframe, glb_ind=Y | sample==1) subset2-subset(dframe, cwar_ind=Y | sample==2) subset3-subset(dframe, reg_ind=Y | sample==3) However, my first conditions (glb_ind,cwar_ind, and reg_ind) all have

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
The problem might be that NAs in the dataset are blank On Wed, Jun 5, 2013 at 9:54 AM, Daniel Tucker dtuck...@u.rochester.eduwrote: Also tried this but results werent any different subset1- subset(dframe, glb_ind=Y | sample==1 | !is.na(glb_ind)) subset2-subset(dframe, cwar_ind=Y |sample==2

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Daniel Tucker
Also tried this but results werent any different subset1- subset(dframe, glb_ind=Y | sample==1 | !is.na(glb_ind)) subset2-subset(dframe, cwar_ind=Y |sample==2 | !is.na(cwar_ind)) subset3-subset(dframe, reg_ind=Y | sample==3 | !is.na(reg_ind)) On Wed, Jun 5, 2013 at 9:33 AM, Daniel Tucker

Re: [R] Subsetting out missing values for a certain variable

2013-06-05 Thread Jorge I Velez
Daniel, You need == instead of =. HTH, Jorge.- Sent from my phone. Please excuse my brevity and misspelling. On Jun 6, 2013, at 10:36 AM, Daniel Tucker dtuck...@u.rochester.edu wrote: Also tried this but results werent any different subset1- subset(dframe, glb_ind=Y | sample==1 |