The FAQ explains the need to use the yearmonth class:
"It is unclear for this case to tell if it’s daily data with implicit missingness or it’s monthly data. If using Date underlying monthly data, each month could range from 28 to 31 days, which isn’t regularly spaced. But class yearmonth puts emphasis on 12 months per year, which is clearly regularly spaced and the accurate representation for aggregations over months. "
But this is confusing to a new user wanting to convert an existing data frame with the as_tsibble function. The different ways to specify monthly, daily data could be explained as different examples in the help of the as_tsibble function.
Clearly the yearmonth class is used in the examples in the help page of the as_tsibblefunction, so it probably just needs an introduction, explanation of the difference with a standard POSIXct, format.
tbl2 <- tibble(
mth = rep(yearmonth("2017-01") + 0:9, 3),
group = rep(c("x", "y", "z"), each = 10),
value = rnorm(30)
)
The FAQ explains the need to use the
yearmonth
class:Usage illustrated in this example:
But this is confusing to a new user wanting to convert an existing data frame with the as_tsibble function. The different ways to specify monthly, daily data could be explained as different examples in the help of the
as_tsibble
function.Clearly the
yearmonth
class is used in the examples in the help page of theas_tsibble
function, so it probably just needs an introduction, explanation of the difference with a standard POSIXct, format.