I am trying to solve a very simple problem. I want to take out a particular quarter data out of a tsibble
.
I have this code,
library(tidyverse)
library(tsibble)
x <- tsibble(
qtr = rep(yearquarter("2010 Q1") + 0:9, 3),
group = rep(c("x", "y", "z"), each = 10),
value = rnorm(30),
key = group
)
Now I want to subset the 2010 Q1 data out,
x %>% filter(qtr == "2010 Q1")
I am getting this error message,
> x %>% filter(qtr == "2010 Q1")
Error in charToDate(x) :
character string is not in a standard unambiguous format
What am I doing wrong here?