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:
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.
Erik Iverson er...@ccbr.umn.edu 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
Erik Iverson eriki at 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
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
5 matches
Mail list logo