[R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I have two very basic questions (console attached): 1) What am I getting an error message for # 5 and # 7 ? 2) How to fix the code? I would appreciate receiving your help. Thanks, Pradip Muhuri ## Reproducible Example # N - 100 set.seed(13)

Re: [R] subsetting - questions

2012-11-23 Thread Jorge I Velez
Hi Pradip, It is easier to use subset(). Check ?subset for some examples and pay special attention to the select parameter. By the way, do not call your data df as it is already a function. Best, Jorge.- On Sat, Nov 24, 2012 at 1:55 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello, I

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hi Arun, Thank you so much for your help. Pradip From: arun [smartpink...@yahoo.com] Sent: Friday, November 23, 2012 10:15 PM To: Muhuri, Pradip (SAMHSA/CBHSQ) Cc: R help Subject: Re: [R] subsetting - questions HI, This should work: df[df$X1=8,][-which

Re: [R] subsetting - questions

2012-11-23 Thread Peter Ehlers
On 2012-11-23 18:55, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello, I have two very basic questions (console attached): 1) What am I getting an error message for # 5 and # 7 ? 2) How to fix the code? I would appreciate receiving your help. Thanks, Pradip Muhuri ## Reproducible Example

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
] subsetting - questions Hi Pradip, It is easier to use subset(). Check ?subset for some examples and pay special attention to the select parameter. By the way, do not call your data df as it is already a function. Best, Jorge.- On Sat, Nov 24, 2012 at 1:55 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote

Re: [R] subsetting - questions

2012-11-23 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
From: Peter Ehlers [ehl...@ucalgary.ca] Sent: Friday, November 23, 2012 10:47 PM To: Muhuri, Pradip (SAMHSA/CBHSQ) Cc: r-help@r-project.org Subject: Re: [R] subsetting - questions On 2012-11-23 18:55, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello, I have two very

Re: [R] subsetting - questions

2012-11-23 Thread arun
Message - From: Muhuri, Pradip (SAMHSA/CBHSQ) pradip.muh...@samhsa.hhs.gov To: r-help@r-project.org r-help@r-project.org Cc: Sent: Friday, November 23, 2012 9:55 PM Subject: [R] subsetting - questions Hello, I have two very basic questions (console attached): 1) What am I getting an error