Learn R Programming

EloRating (version 0.46.18)

lastdaypresent: 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)

Value

Date or NA

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

Author

Christof Neumann

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

Examples

Run this code
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")

Run the code above in your browser using DataLab