Hi I'm pretty sure there's some built-in function to do the equivalent of this, but I couldn't find one anywhere:
gp <- function(init, mult, n) { if (n == 1) init else pg(c(init, init[length(init)] * mult), mult, n-1) } > gp(1, 2, 10) [1] 1 2 4 8 16 32 64 128 256 512 1024 Any pointers? Thanks, Andre ______________________________________________ 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.