regularly {businessPlanR}R Documentation

Generate list of repeating financial transactions

Description

For all years defined, generates a list of values as defined by pa and due at the given month. The result can be used as input for the .list argument of expense, revenue, and transaction.

Usage

regularly(
  years,
  pa,
  month = "01",
  last = 0,
  first = 0,
  merge = list(),
  digits = 2
)

Arguments

years

Integer vector, the range of years to cover.

pa

A vector with values for each year. This amounts to the total sum for the respective year.

month

Character, but numeric description of a month in "MM" format when to account the values of pa. If you provide more than a single month here, e.g., quarterly payments, the amounts defined by pa are divided the number of months.

last

Defines the final entry, last month of the last year. It can be either a numeric value (taken as-is), "rep" (repeats the last value of pa), or "none" to omit adding a last month (e.g., to later merge with results of another call to this function). Only used if month is not "12".

first

Defines how to treat years if January was included in in month. This could be desired for merging, but problematic if you want to create a new transaction object. Valid values are the same as for last except "rep".

merge

Another list of values to be merged with the results, can be used for nested calls of this function to generate more complex patterns.

digits

Number of digits used for rounding when month is more than one entry.

Value

A list of monthly transactions named in "YYYY.MM" scheme (regularly_delayed).

Examples

expense(
    type="Operation",
    category="Insurance",
    name="Electronics",
    missing="0",
    .list=regularly(
        years=2021:2025,
        pa=rep(111.11, 5),
        month="01",
        last=0
    )
)

[Package businessPlanR version 0.1-0 Index]