0

There's a small issue with tsibble::yearmonth. See this list of year - months values:

x <- c("2016.09", "2016.10", "2016.11", "2016.12")

When I call tsibble::yearmonth (tsibble version 1.0.0), I obtain this:

tsibble::yearmonth(x)
<yearmonth[4]>
[1] "2016 Sep" "2016 Oct" "2016 Jan" "2016 Feb"

The function has correctly transformed September and October, but makes an error with November and December.

Workaround exists, e.g.:

tsibble::yearmonth(as.Date(paste0(x, ".01"), format = "%Y.%m.%d"))
<yearmonth[4]>
[1] "2016 Sep" "2016 Oct" "2016 Nov" "2016 Dec"

but it would be nice if yearmonth() recognizes the date properly.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • Sounds like this might be a bug in `tsibble()` I can reproduce the same issue with two digit months on my machine – Nate Feb 25 '21 at 12:11
  • See [tsibble github issue 250](https://github.com/tidyverts/tsibble/issues/250). – phiver Feb 25 '21 at 12:15

0 Answers0