Matthew Wilson <matt <at> overlook.homelinux.net> writes: > > I'm studying R in my free time. I want to build a vector where each > element is equal to the element before it in the sequence plus some > random tweak. >
You will probably get many answers to this, but I think vec <- 100+c(0,cumsum(runif(49,-2,2))) works. Ben Bolker ______________________________________________ R-help@stat.math.ethz.ch 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.