| operations,-class {businessPlanR} | R Documentation |
S4 Class operations
Description
This class is used for objects that contain all transactions of the business plan.
Slots
periodA character vector defining beginning and end of the time period covered by the business plan. Values can either be a vector of two in
YYYY.MMformat, or a numeric vector of full fiscal years which will automatically be transformed into character.revenueData frame containing
type,category,name, and all revenues, each month in a column namedYYYY.MM. If these are not coveringperiodexactly, missing values will be set to zero.expenseData frame containing all expenses, data structure like the
revenueslot.loanData frame, basically the
planslot as intransaction_planwithplan_type="loan".depreciationData frame, like
loan, but withplan_type="depreciation", respectively.miscA list to keep miscellaneous data or information for documentation or re-use.
Constructor function
Should you need to manually generate objects of this class, the constructor function
operations(...) can be used instead of
new("operations", ...).
Examples
rev_2019_2021_merch <- revenue(
type="Sale",
category="Merch",
name="T-Shirts",
"2019.01"=100,
"2019.08"=267,
"2020.03"=344,
"2020.09"=549,
"2021.02"=770,
"2021.07"=1022,
"2021.12"=1263
)
rev_2019_2021_rec <- revenue(
type="Sale",
category="Records",
name="Albums",
"2019.01"=220,
"2019.08"=234,
"2020.03"=221,
"2020.09"=354,
"2021.02"=276,
"2021.07"=285,
"2021.12"=311
)
rev_2019_2021_inv <- revenue(
type="Invest income",
category="Rent",
name="Studio",
"2019.01"=120,
"2019.08"=234,
"2020.03"=321,
"2020.09"=454,
"2021.02"=376,
"2021.07"=385,
"2021.12"=211
)
exp_2019_2021_merch <- expense(
type="Goods",
category="Merch",
name="T-Shirts",
"2019.01"=65,
"2019.07"=170,
"2020.02"=210,
"2020.08"=312,
"2021.01"=450,
"2021.06"=600,
"2021.12"=720
)
exp_2019_2021_rec <- expense(
type="Goods",
category="Records",
name="Pressing",
"2019.01"=1860,
"2019.02"=0,
"2020.08"=600,
"2020.09"=0,
"2021.12"=0
)
op_2019_2021 <- operations(
period=c("2019.01", "2021.12") # alternative: 2019:2021
)
update_operations(op_2019_2021) <- rev_2019_2021_merch
update_operations(op_2019_2021) <- exp_2019_2021_merch
update_operations(op_2019_2021) <- rev_2019_2021_rec
update_operations(op_2019_2021) <- exp_2019_2021_rec
update_operations(op_2019_2021) <- rev_2019_2021_inv