Filling in values in a data frame in R?
Suppose I have this data frame: times vals 1 1 2 2 3 4 3 7 6 set up with foo <- data.frame(times=c(1,3,7), vals=c(2,4,6)) and I want this one: times vals 1 1 2 2 2 2 3 3 4 4 4 4 5 5 4 6 6 4 7 7 6 That is, I … Read more