factor_aweek {aweek} | R Documentation |
Coerce an aweek object to factor to include missing weeks
Description
Coerce an aweek object to factor to include missing weeks
Usage
factor_aweek(x)
Arguments
x |
an aweek object |
Value
an aweek object that inherits from factor()
with levels that span
the range of the weeks in the object.
Note
when factored aweek objects are combined with other aweek objects, they are converted back to characters.
Examples
w <- get_aweek(week = (1:2) * 5, year = 2019, day = c(7, 1))
w
wf <- factor_aweek(w)
wf
# factors are destroyed if combined with aweek objects
c(w, wf)
[Package aweek version 1.0.3 Index]