is_daynight: Is the time day or night.

Description Usage Arguments Value Examples

View source: R/is_daynight.R

Description

SUPPORTER function: Required for add_daynight function This function supports the add_daynight function by creating a function called is_daynight. It first extracts the hour value from a colon-separated 'character' or 'factor' value. Then it checks to see if the hour value is above or below 12. If it is above 12, then it will print "night", if it is less, it will print "day"

Usage

1

Arguments

t

character or factor

Value

dataframe

Examples

1
2
3
4
5
6
a <- "12:30:12"
b <- "4:40:50"
is_day_night(a)
## "night"
is_day_night(b)
## "day"

hochoy/r_timekeeper documentation built on May 17, 2019, 4:36 p.m.