Is it possible to create a seq in R with increasing values by percentage?
For example:
In need a sequence of values from 10500 to approximately 30000 increasing by 1 %
So the first value after 10500 have to be 10605, the next one 10711.5 .....
Is this possible in R with the command seq
? Ore maybe with another Function?
Something like:
seq(10500,30000,1%)
cumprod
is your friend:
cumprod(c(10500, rep(1.01,50)))
produces
[1] 10500.00 10605.00 10711.05 10818.16 10926.34 11035.61 11145.96 11257.42 11370.00 11483.70
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With