depreciation,-class {businessPlanR}R Documentation

S4 Class depreciation

Description

This is a special case of the generic class transaction.

Usage

## S4 method for signature 'depreciation'
initialize(
  .Object,
  type,
  category,
  name,
  amount,
  obsolete,
  invest_month = format(Sys.Date(), "%Y.%m"),
  method = c("linear", "writedown", "sumofyears", "doubledecline"),
  valid_types = "default",
  value
)

Arguments

.Object

The object to initialize.

type

A character string defining the type of transaction as defined by valid_types.

category

A character string, custom category for this transaction.

name

A character string, custom name or ID for this transaction (i.e., a particular asset that was purchased).

amount

Numeric, the amount of money invested into the asset.

obsolete

Integer value defining the period (in months) over which the value of the asset diminishes to zero.

invest_month

Character string in YYYY.MM format, the month of the investment/purchase.

method

One of the following, defining the depreciation method:

  • "linear": The straight line depreciation. This is currently the only implemented option.

  • "writedown": The written-down value depreciation, not yet implemented.

  • "sumofyears": The sum-of-years depreciation, not yet implemented.

  • "doubledecline": The double-declining depreciation, not yet implemented.

valid_types

A character string, the model types defined by set_types to be used for validation. If "default", pre-defined example types are used.

value

A valid data frame to be used as the value slot directly, omitting calculation via amount, obsolete, invest_month, etc.

Details

In contrast to revenue or expense, the time range of this class of objects is defined by details of the investment as specified. Only when used as an aspect of an operations class object, this range is adjusted to fit that particular object.

Slots

type

A character string, for valid values see valid_types. You might use all valid types pre-defined for either revenue or expense, considering that you might be the depreciation giver or receiver.

category

A character string, custom category for this depreciation.

name

A character string, custom name or ID for this depreciation.

value

Data frame containing an investment plan and allowance for depreciation balance, each month in a row named YYYY.MM. The columns are investment, depreciation, and remaining value.

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 depreciation(...) can be used instead of new("depreciation", ...).

NA

Should you need to manually generate objects of this class, the constructor function depreciation(...) can be used instead of new("depreciation", ...).

Examples

depreciation_printer <- depreciation(
    type="Depreciation",
    category="Office",
    name="Printer",
    amount=100,
    obsolete=36,
    invest_month="2019.04"
)

# turn depreciation object into an expense
depreciation_as_expense_printer <- as_transaction(
    depreciation_printer,
    to="expense",
    aspect="depreciation"
)

[Package businessPlanR version 0.1-0 Index]