get_insee_idbank: Get data from INSEE series idbank

Description Usage Arguments Details Value Examples

View source: R/get_insee_idbank.R

Description

Get data from INSEE series idbank

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
get_insee_idbank(
  ...,
  limit = TRUE,
  startPeriod = NULL,
  endPeriod = NULL,
  firstNObservations = NULL,
  lastNObservations = NULL,
  includeHistory = NULL,
  updatedAfter = NULL
)

Arguments

...

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)

Details

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")

Value

a tibble with the data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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]))

hadrilec/insee documentation built on Oct. 13, 2021, 12:03 p.m.