Re: [R] Subset using partial values

2010-03-04 Thread Newbie19_02
Thanks very much David and Henrique for your help. It has made my life much simpler. -- View this message in context: http://n4.nabble.com/Subset-using-partial-values-tp1576614p1577792.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Subset using partial values

2010-03-03 Thread David Winsemius
On Mar 3, 2010, at 9:04 AM, Newbie19_02 wrote: Thanks again for the help but what I am having trouble with is that I get: 1012 CAO0103166 01/04/1999 I200 1016 CAO0103166 03/05/2000 I200 1024 CAO0103166 20/06/1997 I209 1025 CAO0103166 25/02/

Re: [R] Subset using partial values

2010-03-03 Thread Henrique Dallazuanna
What is your entire dataset and the code used to do this? On Wed, Mar 3, 2010 at 12:04 PM, Newbie19_02 wrote: > > Thanks again for the help but what I am having trouble with is that I get: > > 1012  CAO0103166     01/04/1999           I200 > 1016  CAO0103166     03/05/2000           I200 > 1024  

Re: [R] Subset using partial values

2010-03-03 Thread Newbie19_02
Thanks again for the help but what I am having trouble with is that I get: 1012 CAO0103166 01/04/1999 I200 1016 CAO0103166 03/05/2000 I200 1024 CAO0103166 20/06/1997 I209 1025 CAO0103166 25/02/1999 I209 1027 CAO0103166 27/08/1999

Re: [R] Subset using partial values

2010-03-03 Thread Henrique Dallazuanna
Then: subset(x, grepl('410|I25', main_condition)) On Wed, Mar 3, 2010 at 11:59 AM, Newbie19_02 wrote: > > Hi, > > That was a good suggestion but I should have been more specific, >         PROCHI            Date_admission      main_condition >         CAO3121534     15/08/2006           I501 > 2

Re: [R] Subset using partial values

2010-03-03 Thread Newbie19_02
Hi, That was a good suggestion but I should have been more specific, PROCHIDate_admission main_condition CAO3121534 15/08/2006 I501 28394 CAO3121534 18/04/1999 I251 28395 CAO3121534 18/10/1993 4109 28396 CAO3121534 1

Re: [R] Subset using partial values

2010-03-03 Thread Henrique Dallazuanna
Try this: subset(x, grepl('411', Main_condition)) On Wed, Mar 3, 2010 at 11:33 AM, Newbie19_02 wrote: > > Hi everyone, > > I would like to subset a data.frame using partial values. > > For example I have the following data.frame: > > PROCHI  Main_condition > 1234      411 > 1235     4110 > 1236

[R] Subset using partial values

2010-03-03 Thread Newbie19_02
Hi everyone, I would like to subset a data.frame using partial values. For example I have the following data.frame: PROCHI Main_condition 1234 411 1235 4110 1236 4111 1237 I20 1238I201 1239I202 Now let's say that I use the Subset function. Ordinarily I would use it a