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
NULLto exclude nothing.- flags
Extra flags to pass to
register. If usingledgermay want to try something like"-X USD".- toolchain
Toolchain used to read in register. Either
"ledger","hledger","beancount","bean-query", or"rledger".- ignore_case
logical value of whether to ignore case in regular expressions or not.
Examples
if (FALSE) { # \dontrun{
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"))
} # }