lastdaypresent: last day an individual was present

View source: R/lastdaypresent.R

lastdaypresentR Documentation

last day an individual was present

Description

last day an individual was present with respect to a reference date

Usage

lastdaypresent(x, ID = "all", refdate = NULL)

Arguments

x

output from elo.seq

ID

character, if "all", all individuals are returned, otherwise only for the desired ID

refdate

character or Date (YYYY-MM-DD), up to which date the presence data should be considered, by default the last date of the sequene

Details

the function can result in NA for two reasons. 1) the ID is not found in the presence data, which is accompanied by a warning and 2) the ID was not yet present if a referene date is specified

Value

Date or NA

Author(s)

Christof Neumann

Examples

data(adv)
data(advpres)
SEQ <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date,
               presence = advpres)
lastdaypresent(SEQ, ID = "all", refdate = "2010-01-02")
lastdaypresent(SEQ, ID = "f", refdate = "2010-02-02")

gobbios/EloRating documentation built on July 19, 2024, 4:05 a.m.