I have a df that comes from an api with a Trimestre (Código)
column in string format:
pib$`Trimestre (Código)` <- c(199101,199102,199103,199104,199201,199202,...)
but i need to mutate this column into date format. I have tried the folowing:
>
> pib %>%
> mutate(date = parse_date(`Trimestre (Código)`, format='%Y%q')) %>%
> select('Trimestre (Código)', "Setores e subsetores", Valor) %>%
> pivot_wider(names_from = "Setores e subsetores",
> values_from = Valor)
but I just receive the error 'unsupported format %q'. How to do it?
lubridate::yq(your_date_vector)
will do?