Learn R Programming

R4GoodPersonalFinances

Make Optimal Financial Decisions

The R4GoodPersonalFinances R package is a set of tools designed to help you plan and make informed, data-driven decisions for your personal or household finances.
These tools are selected carefully to align with academic consensus, bridging the gap between theoretical knowledge and practical application. They assist you in:

  • finding optimal asset allocation,
  • preparing for retirement or financial independence,
  • calculating optimal spending,
  • and more.

Installation

Installation from CRAN

The latest stable version of the package released on CRAN can be installed with:

# install.packages("pak")
pak::pak("R4GoodPersonalFinances")

Installation from GitHub

You can install the latest version of R4GoodPersonalFinances from GitHub with:

# install.packages("pak")
pak::pak("R4GoodAcademy/R4GoodPersonalFinances")

Installation from R-universe

You can install the package from R-universe also as WebAssembly (WASM) binaries for use in WebR applications:

install.packages(
  "R4GoodPersonalFinances", 
  repos = c(
    "https://r4goodacademy.r-universe.dev", 
    "https://cloud.r-project.org"
  )
)

Acknowledgments

  • Haghani V., White J. (2023) The Missing Billionaires: A Guide to Better Financial Decisions. ISBN:9781119747918.
  • Idzorek, Thomas M., and Paul D. Kaplan. (2024) Lifetime Financial Advice: A Personalized Optimal Multilevel Approach. CFA Institute Research Foundation. ISBN:9781952927379.
  • Milevsky, Moshe. (2020) Retirement Income Recipes in R: From Ruin Probabilities to Intelligent Drawdowns. Springer. doi.org/10.1007/978-3-030-51434-1.

R for Good Academy

The R4GoodPersonalFinances R package is part of the R for Good Academy project. You can find there free resources explaining in details concepts of personal finances implemented in this R package.

The official package documentation can be found here:
r4goodacademy.github.io/R4GoodPersonalFinances

Make Optimal Financial Decisions with the R4GoodPersonalFinances R package!

Copy Link

Version

Install

install.packages('R4GoodPersonalFinances')

Monthly Downloads

186

Version

1.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Kamil Wais

Last Published

November 23rd, 2025

Functions in R4GoodPersonalFinances (1.2.0)

life_tables

HMD life tables
plot_expected_allocation

Plot expected allocation over household life cycle
calc_retirement_ruin

Calculating retirement ruin probability
calc_risk_adjusted_return

Calculate risk adjusted return
plot_gompertz_calibration

Plotting the results of Gompertz model calibration
plot_joint_survival

Plotting the results of Gompertz model calibration for joint survival
plot_optimal_portfolio

Plot optimal portfolio allocations
plot_life_expectancy

Plot life expectancy of household members
simulate_scenarios

Simulate multiple scenarios of household lifetime finances
plot_expected_capital

Plot expected capital over household life cycle
simulate_scenario

Simulate a scenario of household lifetime finances
plot_future_income

Plot future income structure over household life cycle
plot_future_spending

Plot future spending structure over household life cycle
run_app

Run a package app
render_scenario_snapshot

Rendering a scenario snapshot
plot_future_saving_rates

Plotting future saving rates
plot_survival

Plot survival of household members
read_hmd_life_tables

Reading HMD life tables
plot_scenarios

Plot scenarios metrics
plot_risk_adjusted_returns

Plotting risk adjusted returns
plot_purchasing_power

Plotting changes to the purchasing power over time
plot_retirement_ruin

Plotting retirement ruin
calc_gompertz_joint_parameters

Calculating the Gompertz model parameters for joint survival
calc_gompertz_parameters

Calculating Gompertz model parameters
Household

Household class
HouseholdMember

HouseholdMember class
calc_gompertz_mode

Calculate Gompertz mode for a given life expectancy
calc_effective_tax_rate

Calculate Effective Tax Rate
calc_life_expectancy

Calculate Life Expectancy
calc_gompertz_survival_probability

Calculating Gompertz survival probability
R4GoodPersonalFinances-package

R4GoodPersonalFinances: Make Optimal Financial Decisions
get_cache_info

Working with cache
get_current_date

Get current date
format_currency

Printing currency values or percentages
create_portfolio_template

Create Portfolio Template
get_default_gompertz_parameters

Get default Gompertz parameters
calc_optimal_risky_asset_allocation

Calculate optimal risky asset allocation
calc_optimal_asset_allocation

Calculate optimal asset allocation
calc_portfolio_parameters

Calculate Portfolio Parameters
calc_purchasing_power

Calculate purchasing power