addActivity: Add a new entry to the account.

addActivityR Documentation

Add a new entry to the account.

Description

Add a new entry to the account.

Usage

addActivity(object, ...) <- value

## S3 replacement method for class 'butilsAccount'
addActivity(
  object,
  involved = NULL,
  type = as.character(NA),
  date = as.Date(NA),
  note = "",
  label = NULL,
  ...
) <- value

Arguments

object

the account.

...

ignored.

value

[numeric] a named vector describing name paid what.

involved

[vector of characters] who was involved in the activity?

type

[character] the name of the activity.

date

[date, d-m-Y] the date at which the activity happen.

note

[character] additional text.

label

[label] a label associated with the activity. When displayed activities are sorted by labels.

Examples

#### Create an account ####
myAcc <- createAccount()

#### Ease input with short names ####
addNickName(myAcc) <- list("Brice Ozenne" = "Brice",
                           "Sebastian Holst" = c("Seb","Sebastian"))

#### Add activity paid by one person for others ####
addActivity(myAcc, involved = c("Brice","Sebastian"), type = "Court") <- c("Sebastian" = 200)

#### Add expense, i.e. activity paid by nobody ####
addActivity(myAcc, involved = c("Brice","Sebastian"), type = "Shuttlecock") <- 100

#### Add contribution from one member ####
addActivity(myAcc, type = "Shuttlecock") <- c("Brice" = 100)

####
myAcc

bozenne/butils documentation built on Oct. 14, 2023, 6:19 a.m.