update_budget: Updates a budget

Description Usage Arguments Value Examples

View source: R/update_budget.R

Description

update_budget returns an updated budget.

Usage

1
update_budget(budget, start, end, initial)

Arguments

budget

The budget to be updated.

start

The new start date for the budget (if applicable).

end

The new end date for the budget (if applicable).

initial

The new initial amount for the budget (if applicable).

Value

The output of update_budget is a new budget with the specified updates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Create a paycheck item
paycheck <- create_item( name = "Paycheck"
                       , amount = 1000
                       , day = "2016-01-01"
                       , recurring = "monthly"
                       )
# Create a rent item
rent <- create_item( name = "Rent"
                   , amount = -500
                   , day = "2016-01-05"
                   , recurring = "monthly"
                   )
# Create a schedule
my_schedule <- create_schedule(paycheck, rent)
# Create a budget
my_budget <- create_budget(my_schedule, start="2016-01-01", initial=1000)
# Inspect
my_budget

# Update the initial amount
my_budget <- update_budget(my_budget, initial=0)
# Inspect
my_budget

derek-damron/budgetr documentation built on Aug. 11, 2020, 2:41 a.m.