net_worth: Compute net worth

View source: R/net_worth.r

net_worthR Documentation

Compute net worth

Description

Computes net worth for a vector of dates. Computes net worth at the beginning of the day before any transactions have occurred.

Usage

net_worth(
  file,
  date = Sys.Date() + 1,
  include = c("^asset", "^liabilit", "^<revalued>"),
  exclude = NULL,
  flags = "-V",
  toolchain = default_toolchain(file),
  ignore_case = TRUE
)

Arguments

file

Filename for a ledger, hledger, or beancount file.

date

Vector of dates to compute net worth for. For each only the transactions (and price statements) before that date are used in the net worth calculation.

include

Character vector of regular expressions of accounts to include in the net worth calculation. Use ".*" to include everything.

exclude

Character vector of regular expressions of accounts to exclude from the net worth calculation. Use NULL to exclude nothing.

flags

Extra flags to pass to register. If using ledger may want to try something like "-X USD".

toolchain

Toolchain used to read in register. Either "ledger", "hledger", "bean-report_ledger", or "bean-report_hledger".

ignore_case

logical value of whether to ignore case in regular expressions or not.

Value

net_worth returns a tibble

Examples

   ## Not run: 
     example_beancount_file <- system.file("extdata", "example.beancount", package = "ledger")
     net_worth(example_beancount_file)
     net_worth(example_beancount_file, c("2016-01-01", "2017-01-01", "2018-01-01"))
   
## End(Not run)

ledger documentation built on May 29, 2024, 1:21 a.m.