getMinTime: Get the minimum/maximum start/end time among elements

Description Usage Arguments Value Examples

Description

Get the minimum/maximum start/end time among elements

Usage

1
2
3
getMinTime(gantt, a, which, strict = T)

getMaxTime(gantt, a, which, strict = T)

Arguments

gantt

A gantt object (created by makeGantt)

a

a vector of elements to compare

which

Which time to compare ("start" or "end")

strict

If TRUE and an element among the compared is not present, NA is returned.

Value

Returns minimum/maximum time in seconds of the earliest/latest element starting/ending

Examples

1
2
3
4
5
6
response<-matrix(c("{'response':'1/8 17:00;;1/8 17:00 - 1/8 18:00;1/8 18:00, 1/8 20:00 - 1/8 21:00;1/8 20:30;1/8 20:00 - 1/8 20:30;1/8 19:30 - 1/8 20:30'}"))
gantt<-makeGantt(response,names=c("waitress","actor","pianist","bartender","cleaning","ticketer","musician"),timespan=30,time.format="%d/%m %H:%M")
getMinTime(gantt,c("pianist","bartender"),which="start")
getMaxTime(gantt,c("actor","bartender"),which="end",strict=F)
getMaxTime(gantt,"actor",which="end")
as.difftime(getMaxTime(gantt,c("pianist","bartender"),which="end")-getMinTime(gantt,c("pianist","bartender"),which="start"),units = "secs")

openPCI/OpenPCIScoring documentation built on June 10, 2021, 1:18 p.m.