create_budget: Creates a budget

Description Usage Arguments Value Examples

View source: R/create_budget.R

Description

create_budget returns a budget.

Usage

1
create_budget(schedule, start = Sys.Date(), end = start + 90, initial = 0)

Arguments

schedule

A budget schedule.

start

The start date for the budget. The default is today's date. If provided must be either a Date object or a character or numeric object that can be converted by lubridate's ymd function.

end

The end date for the budget. The default is 90 days after today's date. If provided must be either a Date object or a character or numeric object that can be converted by lubridate's ymd function and be after the start date.

initial

The initial amount for the budget. The default is 0.

Value

The output of create_budget is a budget.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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

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