register: Import a ledger, hledger, or beancount register

View source: R/register.r

registerR Documentation

Import a ledger, hledger, or beancount register

Description

register imports the register from a ledger, hledger, or beancount file as a tibble.

Usage

register(file, ..., toolchain = default_toolchain(file), date = NULL)

register_beancount(file, date = NULL)

register_hledger(
  file,
  flags = "",
  date = NULL,
  add_mark = TRUE,
  add_cost = TRUE,
  add_value = TRUE
)

register_ledger(file, flags = "", date = NULL)

Arguments

file

Filename for a ledger, hledger, or beancount file.

...

Arguments passed on to either register_ledger, register_hledger, or register_beancount

toolchain

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

date

End date. Only transactions (and implicitly price statements) strictly before this date are used.

flags

Character vector of additional command line flags to pass to either ledger csv or hledger register.

add_mark

Whether to add a column with the mark information. Only relevant for hledger files.

add_cost

Whether to add historical cost columns. Only relevant for hledger files.

add_value

Whether to add market value columns. Only relevant for hledger files.

Value

register returns a tibble.

Examples

 if (Sys.which("ledger") != "") {
     example_ledger_file <- system.file("extdata", "example.ledger", package = "ledger")
     dfl <- register(example_ledger_file)
     head(dfl)
 }
 if (Sys.which("hledger") != "") {
     example_hledger_file <- system.file("extdata", "example.hledger", package = "ledger")
     dfh <- register(example_hledger_file)
     head(dfh)
 }
 if (Sys.which("bean-query") != "") {
     example_beancount_file <- system.file("extdata", "example.beancount", package = "ledger")
     dfb <- register(example_beancount_file)
     head(dfb)
 }

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