get_istatdata: Download data set by agencyId, id and version (source:...

View source: R/get_istatdata.R

get_istatdataR Documentation

Download data set by agencyId, id and version (source: IstatData)

Description

Download data sets from IstatData (new ISTAT provider). Alternatively, use get_i_stat to download data sets from I.Stat (old ISTAT provider). Note that in this first version of the package, only get_i_stat allows you to download variable labels, while get_istatdata has not this functionality yet. The parameters "agencyId","dataset_id" and "version" to download the data sets can be found using list_istatdata function or search_istatdata function.

Usage

get_istatdata(agencyId,
             dataset_id,
             version,
             start=NULL,
             end=NULL,
             recent=FALSE,
             csv=FALSE,
             xlsx=FALSE)

Arguments

agencyId

data set agencyId

dataset_id

data set id

version

data set version

start

Time value for the start (NULL by default)

end

Time value for the end (NULL bu default)

recent

False by default, if TRUE, the function retrieves data from last 10 years

csv

False by default, if TRUE, the function saves the data set to directory as .csv

xlsx

False by default, if TRUE, the function saves the data set to directory as .xlsx

Value

It returns data set as data.frame. It can be saved to environment or as .csv/.xlsx.

Note

Downloading may take some time. Future versions will speed up the process.

Examples

get_istatdata("IT1", "12_60_DF_DCCV_CONSACQUA_2" , "1.0",recent = TRUE)
get_istatdata("IT1", "12_60_DF_DCCV_CONSACQUA_2" , "1.0", start = 2015, end = 2018)

istat documentation built on Sept. 11, 2024, 7:17 p.m.