Add temporal bins to a dataframe
bin_date(df, date_col = "date", bin = c("year", "month"))
Dataframe, with date_col
, to be augmented with temporal bins
Character. Name of column in df
containing dates
Character or dataframe. If character, any lubridate package
method(s) such as year
for lubridate::year()
or month
for
lubridate::month()
. If dataframe, it must contain a date_col
column with
a match for every instance in df
data_col
(or at least every instance
needed in a temporal bin).
df
with extra columns from bin