I want to create a vector that starts at a predefined value and the next value is the previous times another predefined value.
dcdefmax <- 16500
dcdefgrowth <- 1.025
dcdefvector <- seq(from = 16500, length.out = 50, by = dcdefgrowth)
The resulting vector will be 16,500 16,500 + 1.025 16,500 + 2 * 1.025 ...
but I want 16,500 16,500 * 1.025 16,500 * 1.025^2.
If there's another way to do this, that's fine. I just figured seq was the obvious choice, but I can't think of a way of doing this without a for loop.
question from:
https://stackoverflow.com/questions/66067509/is-there-a-way-to-multiply-with-seq-in-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…