kable_bpR {businessPlanR}R Documentation

Format table from condensed objects

Description

This method uses the kableExtra package for table formatting.

Usage

kable_bpR(
  obj,
  model = get_model(),
  resolution = c("year", "quarter", "month"),
  keep_types = TRUE,
  detailed = FALSE,
  cashflow = FALSE,
  currency = "€",
  DIY = FALSE,
  longtable_clean_cut = TRUE,
  font_size = NULL,
  latex_options = "striped",
  stripe_color = "gray!6",
  years = get_period(obj, years = TRUE),
  detail_names = c(revenue = "Revenue", expense = "Exepense"),
  detail_colors = c(color = "white", background = "grey"),
  cf_init = 0,
  cf_names = c(begin = "Begin", end = "End"),
  space = c(html = " ", latex = "\\,"),
  detail_width,
  ...
)

## S4 method for signature 'operations'
kable_bpR(
  obj,
  model = get_model(),
  resolution = c("year", "quarter", "month"),
  keep_types = TRUE,
  detailed = FALSE,
  cashflow = FALSE,
  currency = "€",
  DIY = FALSE,
  longtable_clean_cut = TRUE,
  font_size = NULL,
  latex_options = "striped",
  stripe_color = "gray!6",
  years = get_period(obj, years = TRUE),
  detail_names = c(revenue = "Revenue", expense = "Exepense"),
  detail_colors = c(color = "white", background = "grey"),
  cf_init = 0,
  cf_names = c(begin = "Begin", end = "End"),
  space = c(html = " ", latex = "\\,"),
  detail_width,
  ...
)

## S4 method for signature 'loan'
kable_bpR(
  obj,
  resolution = c("month", "quarter", "year"),
  currency = "€",
  DIY = FALSE,
  font_size = NULL,
  latex_options = "striped",
  stripe_color = "gray!6",
  loan_names = c(balance_start = "Balance start", interest = "Interest", principal =
    "Principal", total = "Total", cumsum = "Cumulated", balance_remain =
    "Balance remain"),
  space = c(html = " ", latex = "\\,"),
  ...
)

## S4 method for signature 'transaction_plan'
kable_bpR(
  obj,
  resolution = c("month", "quarter", "year"),
  keep_types = FALSE,
  currency = "€",
  DIY = FALSE,
  longtable_clean_cut = TRUE,
  font_size = NULL,
  latex_options = "basic",
  stripe_color = "gray!6",
  years = get_period(obj, years = TRUE),
  dep_names = c(investment = "Investment", depreciation = "Depreciation", value =
    "Value", sum = "Sum"),
  loan_names = c(balance_start = "Balance start", interest = "Interest", principal =
    "Principal", total = "Total", cumsum = "Cumulated", balance_remain =
    "Balance remain", sum = "Sum"),
  space = c(html = " ", latex = "\\,"),
  zeroes = c(html = "#C0C0C0", latex = "gray!25"),
  ...
)

Arguments

obj

An object of class operations or loan.

model

A named list of named lists describing the stepwise accounting rules for all data in in obj.

resolution

One of "month", "quarter", or "year".

keep_types

Logical, whether the returned data frame should keep the intermediate results for each relevant type of transaction. This will add a column type to the data frame.

detailed

Logical, supersedes keep_types. If TRUE, the table includes detailed information all the way down to types, categories, and transaction names.

cashflow

Logical, whether the model describes a cash flow plan. If TRUE, calculations will start with the initial value as specified by cf_init and use the result of each period as the starting value of following periods. This only works if detailed=FALSE.

currency

Character defining a currency symbol.

DIY

Logical, if TRUE returns the kable object prior to any row collapsing, column specs or kable styling, so you can apply all of those as you wish.

longtable_clean_cut

Passed to collapse_rows.

font_size

Passed to kable_styling.

latex_options

Passed to kable_styling.

stripe_color

Passed to kable_styling.

years

Character (or numeric) vector defining the year(s) to be represented in the output. This is intended to be useful for splitting up quarterly or monthly output.

detail_names

A named character vector with two entries, revenue and expense, defining the global names used for the two transaction classes in the data frame if detailed=TRUE.

detail_colors

A named character vector with two entries, color and background, defining the color scheme for position headlines (revenue and expense). Only relevant if detailed=TRUE.

cf_init

Numeric, used as the initial value for cash flow calculations if cashflow=TRUE; i.e., the first beginning cash value.

cf_names

Character vector with two entries named begin and end, used in the resulting table for beginning cash and ending cash.

space

Character, a space definition to put between currency and value.

detail_width

Optional vector of length 3, if given defined the width of the three categorial columns, Type, Category, and Name.

...

Additional arguments passed on to kbl.

loan_names

Like dep_names but with seven named entries, balance_start, interest, principal, total, cumsum, balance_remain, and sum, for loan plans, respectively.

dep_names

A named character vector with four entries, investment, depreciation, value, and sum, used in table to describe the rows of each depreciation item, with sum only being used in the final set of rows showing a summary over all items.

zeroes

Named character vector defining the text color to use for zero amounts, for both LaTeX and HTML format.

Value

An object of class kable.


[Package businessPlanR version 0.1-0 Index]