OECD::OECD() function not found

Expressing anything in a language you don't know is hard but with practice, you become more fluent and things become easier.

It is not clear what you are trying to accomplish but maybe something like this?

library(OECD)
library(tidyverse)

df <- get_dataset("HISTPOP", start_time = 2019, end_time = 2020)

df %>% 
    filter(LOCATION == 'CHE', str_detect(AGE, "(\\d{1,2}_\\d{1,2})|85_OVER")) %>% 
    mutate(ObsValue = as.numeric(ObsValue),
           AGE = fct_inorder(AGE)) %>% 
    ggplot(aes(x = AGE, y = ObsValue)) + 
    geom_col() +
    facet_wrap(~Time) +
    theme(axis.text.x = element_text(angle = 45))

Created on 2022-07-13 by the reprex package (v2.0.1)

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like