add_Date_col {LightLogR} | R Documentation |
Create a Date column in the dataset
Description
Create a Date column in the dataset
Usage
add_Date_col(
dataset,
Date.colname = Date,
group.by = FALSE,
as.wday = FALSE,
Datetime.colname = Datetime
)
Arguments
dataset |
A light logger dataset. Expects a |
Date.colname |
Name of the newly created column. Expects a |
group.by |
Logical whether the output should be (additionally) grouped by the new column |
as.wday |
Logical of whether the added column should calculate day of
the week instead of date. If |
Datetime.colname |
column name that contains the datetime. Defaults to
|
Value
a data.frame
object identical to dataset
but with the added
column of Date data
Examples
sample.data.environment %>% add_Date_col()
#days of the week
sample.data.environment %>%
add_Date_col(as.wday = TRUE, group.by = TRUE) |>
summarize_numeric(remove = c("Datetime"))