businessPlanR (version 0.1-0)

get_revenue: Getter/setter methods for businessPlanR objects

Description

These methods return the requested slots from objects of class operations, revenue, expense, transaction_plan, loan or depreciation, or, in case of their <- counterparts, replace slots with a given value.

Usage

get_revenue(
  obj,
  drop_nonyear_cols = FALSE,
  resolution = c("month", "quarter", "year"),
  only_type,
  not_type
)

# S4 method for operations get_revenue( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year"), only_type, not_type )

get_expense( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year"), only_type, not_type )

# S4 method for operations get_expense( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year"), only_type, not_type )

get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

# S4 method for transaction_plan get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

# S4 method for loan get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

# S4 method for depreciation get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

# S4 method for revenue get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

# S4 method for expense get_value( obj, drop_nonyear_cols = FALSE, resolution = c("month", "quarter", "year") )

get_loans(obj, as_data_frame = TRUE)

# S4 method for operations get_loans(obj, as_data_frame = TRUE)

get_plan(obj, type, category, name, valid_types = "default")

# S4 method for transaction_plan get_plan(obj, type, category, name, valid_types = "default")

get_period(obj, years = FALSE)

# S4 method for operations get_period(obj, years = FALSE)

# S4 method for transaction_plan get_period(obj, years = FALSE)

# S4 method for loan get_period(obj, years = FALSE)

# S4 method for depreciation get_period(obj, years = FALSE)

get_depreciation_plan(obj, as_data_frame = TRUE)

# S4 method for operations get_depreciation_plan(obj, as_data_frame = TRUE)

get_plan_type(obj)

# S4 method for transaction_plan get_plan_type(obj)

get_misc(obj, name)

# S4 method for operations get_misc(obj, name)

set_misc(obj, name) <- value

# S4 method for operations set_misc(obj, name) <- value

list_plans(obj)

# S4 method for transaction_plan list_plans(obj)

get_sum(obj)

# S4 method for revenue get_sum(obj)

# S4 method for expense get_sum(obj)

as_transaction(obj, to, aspect, valid_types = "default", type)

# S4 method for loan as_transaction( obj, to = c("revenue", "expense"), aspect = c("interest", "balance_start", "principal", "total", "cumsum", "balance_remain"), valid_types = "default", type )

# S4 method for depreciation as_transaction( obj, to = c("revenue", "expense"), aspect = c("investment", "depreciation", "value"), valid_types = "default", type )

Value

Depending on the method, either a data frame or a numeric value.

Arguments

obj

An object of class operations, revenue, expense, transaction_plan, loan or depreciation.

drop_nonyear_cols

Logical, whether to drop or keep columns specifying type, category or name or rows.

resolution

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

only_type

Optional character vector, if given, only rows with matching type are returned. Overrides not_type if both are provided.

not_type

Optional character vector, if given, only rows with types not matching the vector entries are returned.

as_data_frame

Logical, if FALSE returns an object of class transaction_plan instead of a data frame.

type

Character string, a valid type name for the resulting object.

category

A character string, custom category for this transaction.

name

Character or integer, specifying which element to get/set. If missing, the whole list is returned/replaced.

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.

years

Logical, if TRUE doesn't return the period vector but a vector of all years in the period.

value

A value to assign to the object.

to

Character string, the transaction class to coerce into.

aspect

Character string, the row/column of the input objects's value data frame to use in the resulting object. All additional data are silently dropped.

Details

If as_transaction(..., aspect="balance_start") is being called on a loan object, only the initial value (and perhaps growth instead of declining values) is used, e.g. as revenue for calculations.