The goal of finance is to provide personal finance tools such as asset allocation.
You can install the released version of finance from CRAN with:
install.packages("finance")
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("eanway/finance")
This is a basic example which shows you how to solve a common problem:
library(finance)
allocate_assets(1, 1, 1)
#> $total_amount
#> [1] 1
#>
#> $annual_amount
#> [1] 1
#>
#> $years_until_available
#> [1] 1
#>
#> $amount_needed_until_available
#> [1] 0.9754115
#>
#> $ratio_total_annual
#> [1] 1
#>
#> $ratio_total_annual_asymptote
#> [1] 19.02459
#>
#> $years_until_available_asymptote
#> [1] 59.91465
#>
#> $is_infinite
#> [1] FALSE
#>
#> $ratio_total_annual_infinite
#> [1] 20
#>
#> $years_until_depleted
#> [1] 2.079908
#>
#> $total_amount_infinite_min
#> [1] 19.02459
#>
#> $annual_amount_infinite_max
#> [1] 0.05256355
#>
#> $percent_bonds
#> [1] 0.8397397
#>
#> $amount_bonds
#> [1] 0.8397397
#>
#> $amount_bonds_infinite_max
#> [1] 0.3315446
#>
#> attr(,"class")
#> [1] "model"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.