term_end: Set the end details of a contract

Description Usage Arguments Details Value Examples

Description

This function can be used to specify the end date of a contract.

Usage

1
2
term_end(contract, end_date, event_name = "end_date", payment = 0,
  receipt = 0)

Arguments

contract

The contract for which the end date is to be specified.

end_date

The end date to be specified.

event_name

An optional name for the event. Defaults to "end_date" (which is reccomended).

payment

The amount paid at the end of the contract. Defaults to 0.

receipt

The amount recieved at the end of the contract. Defaults to 0.

Details

Note that receipt and payment cannot both be specified. If they are an error will be thrown.

Value

A contract object with the term added.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(magrittr)

contract_a <-
  contract() %>%
  term_end(as.Date("2000/01/01"))

contract_a

contract_a %>% schedule()

contract() %>%
 term_end(as.Date("2000/01/01"), event_name = "sale date") %>%
 schedule()

contract() %>%
 term_end(as.Date("2000/02/01"), receipt = 1000) %>%
 schedule()

contract() %>%
 term_end(as.Date("2000/03/01"), payment = 50) %>%
 schedule()

jameslairdsmith/contractr documentation built on May 26, 2019, 9:32 a.m.