Re: [R] correcting a few data in a large data frame. Thanks

2010-05-31 Thread Mr. Natural
David: Thanks. I cannot believe that I had not tried the simple, lwf[lwf$bushno==145 , "bout3"] <- 1 I will mess around with the runs suggestion too. Thanks, Don -- View this message in context: http://r.789695.n4.nabble.com/correcting-a-few-data-in-a-large-data-frame-tp2237834p2237892.html S

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread Mr. Natural
Dennis. Tres cool. I will try it. regards, MN -- View this message in context: http://r.789695.n4.nabble.com/correcting-a-few-data-in-a-large-data-frame-tp2237834p2237891.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread Dennis Murphy
Hi: A simple diagnostic is to check how many distinct run lengths exist in a row - ideally, it should be one or two. If it's more than two, something is amiss. Hence, define f() as a function to determine the number of distinct runs in a given row and call the apply() function with it: f <- funct

Re: [R] correcting a few data in a large data frame

2010-05-31 Thread David Winsemius
On May 31, 2010, at 5:29 PM, Mr. Natural wrote: The data frame is lwf that records the survival of bushes over an 8 year period. Years are called bouts. Dead bushes are recorded as zeros, and live bushes as "1." str(lwf) 'data.frame': 638 obs. of 9 variables: $ bushno: int 1 2 3 4 5 6

[R] correcting a few data in a large data frame

2010-05-31 Thread Mr. Natural
The data frame is lwf that records the survival of bushes over an 8 year period. Years are called bouts. Dead bushes are recorded as zeros, and live bushes as "1." str(lwf) 'data.frame': 638 obs. of 9 variables: $ bushno: int 1 2 3 4 5 6 7 8 9 10 ... $ bout1 : int 0 1 0 1 1 1 0 1 0 1 ...