Append a column with a given date's day type (weekday or weekend), day of week, and day category (holiday, weekend, or weekday)

add_day_type(sensor_data)

Arguments

sensor_data

data frame for single sensor returned from pull_sensor()

Value

The original data.table with additional columns

  • day_type either "Weekday" or "Weekend"

  • day_of_week one of "Monday", "Tuesday", etc.

  • day_category one of "Weekday", "Weekend", or "Holiday"