View source: R/get_insee_idbank.R
get_insee_idbank | R Documentation |
Get data from INSEE series idbank
get_insee_idbank( ..., limit = TRUE, startPeriod = NULL, endPeriod = NULL, firstNObservations = NULL, lastNObservations = NULL, includeHistory = NULL, updatedAfter = NULL )
... |
one or several series key (idbank) |
limit |
by default, the function get_insee_idbank has a 1200-idbank limit. Set limit argument to FALSE to ignore the limit or modify the limit with the following command : Sys.setenv(INSEE_idbank_limit = 1200) |
startPeriod |
start date of data |
endPeriod |
end date of data |
firstNObservations |
get the first N observations for each key series (idbank) |
lastNObservations |
get the last N observations for each key series (idbank) |
includeHistory |
boolean to access the previous releases (not available on all series) |
updatedAfter |
starting point for querying the previous releases (format yyyy-mm-ddThh:mm:ss) |
Get data from INSEE series idbanks. The user can disable the download display in the console with the following command : Sys.setenv(INSEE_download_verbose = "FALSE")
a tibble with the data
#example 1 : import price index of industrial products and turnover index : manufacture of wood data = get_insee_idbank("001558315", "010540726") #example 2 : unemployment data library(tidyverse) df_idbank_list_selected = get_idbank_list("CHOMAGE-TRIM-NATIONAL") %>% #unemployment dataset filter(SEXE == 0) %>% #men and women add_insee_title() idbank_list_selected = df_idbank_list_selected %>% pull(idbank) unem = get_insee_idbank(idbank_list_selected) #example 3 : French GDP growth rate library(tidyverse) df_idbank_list_selected = get_idbank_list("CNT-2014-PIB-EQB-RF") %>% # Gross domestic product balance filter(FREQ == "T") %>% #quarter filter(OPERATION == "PIB") %>% #GDP filter(NATURE == "TAUX") %>% #rate filter(CORRECTION == "CVS-CJO") #SA-WDA, seasonally adjusted, working day adjusted idbank = df_idbank_list_selected %>% pull(idbank) data = get_insee_idbank(idbank) %>% add_insee_metadata() #plot ggplot(data, aes(x = DATE, y = OBS_VALUE)) + geom_col() + ggtitle("French GDP growth rate, quarter-on-quarter, sa-wda") + labs(subtitle = sprintf("Last updated : %s", data$TIME_PERIOD[1]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.