Learn R Programming

businessPlanR (version 0.1-0)

update_plan<-: Update transaction_plan objects

Description

You can use this method to add or replace depreciation or loan class objects to/in an existing object of class transaction_plan.

Usage

update_plan(obj) <- value

# S4 method for transaction_plan update_plan(obj) <- value

Value

An updated object of class transaction_plan.

Arguments

obj

An object of class transaction_plan.

value

An object of class depreciation or loan.

Examples

Run this code
depreciation_printer <- depreciation(
    type="Depreciation",
    category="Office",
    name="Printer",
    amount=100,
    obsolete=36,
    invest_month="2019.04"
)
depreciation_laptop <- depreciation(
    type="Depreciation",
    category="Office",
    name="Laptop",
    amount=1200,
    obsolete=36,
    invest_month="2019.02"
)
# initialize an empty plan
dep_plan <- transaction_plan()
# add your assets to the plan
update_plan(dep_plan) <- depreciation_printer
update_plan(dep_plan) <- depreciation_laptop

Run the code above in your browser using DataLab