Re: [R] Within ID variable delete all rows after reaching a specific value

2014-04-26 Thread arun
Hi, You may also try: set.seed(425) ##your code tmp <- data.frame( # tmp1 <- tmp str(tmp1) #'data.frame':    1000 obs. of  3 variables: # $ X1: Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ... # $ X2: Factor w/ 127 levels "1","10","100",..: 1 1 1 1 1 1 1 1 2 2 ... # $ X3: Factor w/

Re: [R] Within ID variable delete all rows after reaching a specific value

2014-04-26 Thread Jeff Newmiller
Jennifer: a) Don't post in HTML... read the Posting Guide. b) Don't make data frames by first making matrices... you rarely create what you think you are creating. In your case, your code creates a bunch of factor columns... use the str() function to verify that your data are sensible before

Re: [R] Within ID variable delete all rows after reaching a specific value

2014-04-25 Thread Jim Lemon
On 04/26/2014 12:42 PM, Jennifer Sabatier wrote: So, I know that's a confusing Subject header. Here's similar data: tmp<- data.frame(matrix( c(rbinom(1000, 1, .03), array(1:127, c(1000,1)), array(format(seq(ISOdate(

[R] Within ID variable delete all rows after reaching a specific value

2014-04-25 Thread Jennifer Sabatier
So, I know that's a confusing Subject header. Here's similar data: tmp <- data.frame(matrix( c(rbinom(1000, 1, .03), array(1:127, c(1000,1)), array(format(seq(ISOdate(1990,1,1), by='month', length=56), format='%d.%m.%Y')