[R] assigning creating missing rows and values
Schatzi
adele_thompson at cargill.com
Thu May 12 22:33:17 CEST 2011
I have a dataset where I have missing times (11:00 and 16:00). I would like
the outputs to include the missing time so that the final time vector looks
like "realt" and has the previous time's value. Ex. If meas at time 15:30 is
0.45, then the meas for time 16:00 will also be 0.45.
meas are the measurements and times are the times at which they were taken.
meas<-runif(18)
times<-c("08:30","09:00","09:30","10:00","10:30","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00",
"15:30" ,"16:30","17:00","17:30","18:00")
output<-data.frame(meas,times)
realt<-c("08:30","09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00","17:30","18:00")
-----
In theory, practice and theory are the same. In practice, they are not - Albert Einstein
--
View this message in context: http://r.789695.n4.nabble.com/assigning-creating-missing-rows-and-values-tp3518633p3518633.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list