I've created a data frame in R, but in order to clean up some of the data,
I need to set certain variable observations equal to the value of their
previous observation (it would be conditional, but that part's less
important right now). In Stata, I would simply set var = var[_n-1] in those
cases. What is the R equivalent?

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to