bizhours: bizhours

Description Usage Arguments Details Value Author(s)

Description

Calculate the business hours between two datetime vectors

Usage

1
2
bizhours(from_dates, to_dates, start_time, end_time, timezone = "",
  calendar = "")

Arguments

from_dates

A vector of POSIXct objects that are date-times from when to start calculating business hours.

to_dates

A vector of POSIXct objects that are date-times till when to calculate business hours.

start_time

Start of work shift. A string in format in 24 hour format - of the day when the business hours start.

end_time

End of work shift. A string in format in 24 hour format- of the day when the business hours end.

timezone

A string that represents the timezone. Default: "" - local timezone

calendar

A string that represents the name of the bizdays calendar to use. Default: "" - uses Brazil/ANBIMA calendar of package bizdays with workweek from Monday through Friday.

Details

Calculates the difference between two vectors of date times in terms of business hours, where business hours is determined using the start_time and end_time parameters. The function can be used seamlessly for night-shift calculations, eg. for a 9pm to 6am shift, start_time is 21:00 and end_time is 06:00

Value

A numeric vector that shows the difference in business hours between from_dates and to_dates

Author(s)

Sujeet G Pillai


sujeetp97/bizhours documentation built on May 29, 2019, 9:51 a.m.