x <- c(9.777, 10.04, 9.207, 9.406)
div <- 0.7
t <- 3
div_adjust(x, t, div)
div_adjust(x, t, div, FALSE)
## assume there were three splits: adjust shares outstanding
shares <- c(100, 100, 200, 200, 1000, 1500)
t <- c(3, 5, 6)
ratio <- c(2, 5, 1.5)
### => invert ratio
split_adjust(shares, t, 1/ratio)
## [1] 1500 1500 1500 1500 1500 1500
split_adjust(shares, t, 1/ratio, backward = FALSE)
## [1] 100 100 100 100 100 100
Run the code above in your browser using DataLab