addMatch: Add a new match to the account

addMatchR Documentation

Add a new match to the account

Description

Add a new match to the account.

Usage

addMatch(object, ...) <- value

## S3 replacement method for class 'butilsAccount'
addMatch(
  object,
  involved = NULL,
  date = as.Date(NA),
  shuttlecock = NULL,
  price.shuttlecock = 175/12,
  refund = NULL,
  note = "",
  print.balance = TRUE,
  replace.entry = FALSE,
  ...
) <- value

Arguments

object

the account.

...

ignored.

value

[numeric] a named vector describing name paid what.

involved

[vector of characters] the names of the players.

date

[date] the date at which the activity happen.

shuttlecock

[interger > 0] the number of shuttlecock used.

price.shuttlecock

[numeric] the price of a single shuttlecock.

refund

[list] A named list indicating who has refunded who.

note

[character] additional text.

print.balance

[logical] should the balance for the match be displayed.

replace.entry

[logical] erase any entry that have the same name.

Examples

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

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

#### Add a single - no shuttlecock ####
addMatch(myAcc, date = "12-06-2017", involved = c("Brice","Sebastian")) <- c("Sebastian" = 200)
addMatch(myAcc, date = "12-06-2017", involved = c("Brice","Sebastian","Sebastian")) <- c("Sebastian" = 200)
addMatch(myAcc, date = "15-06-17", shuttlecock = 5, 
                involved = c("Brice","Sebastian")) <- c("Thomas" = 200)

addActivity(myAcc,
           label = "Shuttlecock-Brice",
           date = as.Date("18-01-13"),
           note = "shuttlecock (1 tube)",
           type = "Buy-Shuttlecock") <- c("Brice" = 170)


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