Get dataset from INSEE BDM database

get_insee_dataset(
  dataset,
  startPeriod = NULL,
  endPeriod = NULL,
  firstNObservations = NULL,
  lastNObservations = NULL,
  includeHistory = NULL,
  updatedAfter = NULL,
  filter = NULL
)

Arguments

dataset

dataset name to be downloaded

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)

filter

Use the filter to choose only some values in a dimension. It is recommended to use it for big datasets. A dimension left empty means all values are selected. To select multiple values in one dimension put a "+" between those values (see example)

Value

a tibble with the data

Details

Get dataset from INSEE BDM database

Examples

# \donttest{
insee_dataset = get_dataset_list()
#> Cached data has been used
idbank_ipc = get_idbank_list("IPC-2015")
#> Cached data has been used

#example 1
data = get_insee_dataset("IPC-2015", filter = "M+A.........CVS..", startPeriod = "2015-03")
#> 1/1 - Data download & Dataframe build :
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================================| 100%
#> 
#> Data cached : /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//Rtmp0yEEwV/d0cf1283af4323191a1ca24bd0113847.rds
#> 

#example 2
data = get_insee_dataset("IPC-2015", filter = "A..SO...VARIATIONS_A....BRUT..SO",
 includeHistory = TRUE, updatedAfter = "2017-07-11T08:45:00")
#> Response [https://bdm.insee.fr/series/sdmx/data/IPC-2015/A..SO...VARIATIONS_A....BRUT..SO?includeHistory=true&updatedAfter=2017-07-11T08:45:00]
#>   Date: 2023-03-18 17:45
#>   Status: 404
#>   Content-Type: application/json
#>   Size: 471 B
#> <?xml version="1.0" encoding="UTF-8"?>
#> An error occurred
#> 
#> If a work computer is used, a proxy server may prevent this package from accessing the internet
#> In this case, please ask your IT support team to provide you with the proxy server settings
#> Then, have a look at the following tutorial to use these settings:
#> https://cran.r-project.org/web/packages/insee/vignettes/insee.html
#> 
#> The query may be too big, please use the filters
# }