net_worth: Compute net worth

Description Usage Arguments Value Examples

View source: R/net_worth.r

Description

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

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
   ## 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)

trevorld/ledgeR documentation built on Nov. 14, 2021, 8:43 a.m.