Description Usage Arguments Value Examples
DEPENDENT function: Dependent on add_datetime and is_daynight support functions This function adds a single column of day or night to all rows of a given dataframe. This function builds on and is dependent on the add_datetime package. How it works is this funciton grabs the time values in the dataframe and determines if it is night or day by seeing if the hour element is above or below 12. If there is already a day_or_night or time column, the function will print an error message.
1 |
df |
dataframe |
dataframe
1 2 3 4 5 6 | fruit_harvest <- data.frame(apples = c(4,10,12), oranges = c(8,9,10))
add_daynight(df)
## apples oranges date time day_or_night
## 1 4 8 2015-11-26 23:47:15 night
## 2 10 9 2015-11-26 23:47:15 night
## 3 12 10 2015-11-26 23:47:15 night
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.