Re: [R] correcting a few data in an unreshaped data frame

2010-06-09 Thread Mr. Natural
Joris: Very, very nice. I have spent the day learning about indices. Thank you very much. Mr. Natural -- View this message in context: http://r.789695.n4.nabble.com/correcting-a-few-data-in-an-unreshaped-data-frame-tp2248219p2249599.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] correcting a few data in an unreshaped data frame

2010-06-09 Thread Joris Meys
Use indices. Eg: # a sample dataframe lupepn1 <- data.frame( bushno=rep(1:2,4), bout=rep(1:4,each=2), survival=rep(0,8), wwg=rep(1,8) ) lupepn1 # select the wrong cases wrong <- lupepn1$bushno==1 & lupepn1$bout %in% c(1,2) # make a replacement frame replacement <- rbind(c(4,5),c(9,10)) #

[R] correcting a few data in an unreshaped data frame

2010-06-08 Thread Mr. Natural
Thanks for the excellent help on my recent question on this topic in which the data frame had been reshaped by cast. Now, I would like to access and change erroneous data in a data frame that has not been reshaped. The file is lupepn1, with identifier variables bushno & bout and dependent variabl