Re: [R] creating a reverse geometric sequence

2010-05-23 Thread David Winsemius
On May 23, 2010, at 1:43 PM, Erik Iverson wrote: Hello, Can anyone think of a non-iterative way to generate a decreasing geometric sequence in R? For example, for a hypothetical function dg, I would like: > dg(20) [1] 20 10 5 2 1 where I am using integer division by 2 to get each subsequ

Re: [R] creating a reverse geometric sequence

2010-05-23 Thread Ben Bolker
Erik Iverson ccbr.umn.edu> writes: > Can anyone think of a non-iterative way to generate a decreasing geometric > sequence in R? Reduce("%/%",rep(2,4),init=20,accum=TRUE) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] creating a reverse geometric sequence

2010-05-23 Thread Dan Davison
Erik Iverson writes: > Hello, > > Can anyone think of a non-iterative way to generate a decreasing > geometric sequence in R? > > For example, for a hypothetical function dg, I would like: > >> dg(20) > [1] 20 10 5 2 1 > > where I am using integer division by 2 to get each subsequent value in > t

Re: [R] creating a reverse geometric sequence

2010-05-23 Thread Duncan Murdoch
Erik Iverson wrote: Hello, Can anyone think of a non-iterative way to generate a decreasing geometric sequence in R? For example, for a hypothetical function dg, I would like: > dg(20) [1] 20 10 5 2 1 where I am using integer division by 2 to get each subsequent value in the sequence.

[R] creating a reverse geometric sequence

2010-05-23 Thread Erik Iverson
Hello, Can anyone think of a non-iterative way to generate a decreasing geometric sequence in R? For example, for a hypothetical function dg, I would like: > dg(20) [1] 20 10 5 2 1 where I am using integer division by 2 to get each subsequent value in the sequence. There is of course: d