transaction,-class {businessPlanR} | R Documentation |
S4 Class transaction
Description
This is a generic class used by subclasses revenue
and expense
.
Usage
## S4 method for signature 'transaction'
initialize(
.Object,
type,
category,
name,
per_use,
missing = c("rep", "interpol", "0"),
due_month = NA,
valid_types = "default",
...,
.list = list()
)
Arguments
.Object |
The object to initialize. |
type |
A character string defining the type of transaction as defined by |
category |
A character string, custom category for this transaction. |
name |
A character string, custom name or ID for this transaction. |
per_use |
If given, the numbers provided via |
missing |
One of |
due_month |
Character vector to define months where transactions are due. This argument
causes previous amounts to be cumulated and thereby postponed to the given month of a year.
Combined with e.g. |
valid_types |
A character string, the model types defined by
|
... |
Numeric values named in |
.list |
An alternative to |
Slots
type
A character string, valid values are defined by the subclasses.
category
A character string, custom category for this transaction.
name
A character string, custom name or ID for this transaction.
value
Data frame containing all transactions, each month of each year in a column named
YYYY.MM
.valid_types
A character string, the model types defined by
set_types
to be used for validation.
Constructor function
Should you need to manually generate objects of this class, the constructor function
transaction(...)
can be used instead of new("transaction", ...)
. It
uses the same arguments like the initialize()
method.
You should either provide exactly one named value for each month of the full scope of the respective business plan, or at least two, representing the first and last value.
Missing values
How missing values are dealt with depends on the value of the missing
parameter.
By default (missing="rep"
) a given value will be repeated until a later value comes,
which will then be repeated further on. That is,
you can define a staring value and only have to
provide updated values for months that differ from the previous value.
Alternatively, missing="interpol"
will interpolate missing values linearly, and
missing="0"
fills missing values with zeroes.