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