Learn R Programming

istat (version 1.1.1)

get_istatdata: Download data set by id (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). The parameters "id_dataset" to download the data sets can be found using list_istatdata function or search_istatdata function.

Usage

get_istatdata(id_dataset,
                     start_period = NULL,
                     end_period = NULL,
                     recent = FALSE,
                     csv = FALSE,
                     xlsx = FALSE,
                     lang = "both",
                     cache = TRUE,
                     update_cache=FALSE,
                     compress_file = TRUE,
                     cache_dir = "cache_dir")

Value

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

Arguments

id_dataset

Data set id.

start_period

Time value for the start (NULL by default).

end_period

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.

lang

Language parameter for labels ("ita" for Italian, "eng" for English).

cache

TRUE by default. If FALSE, the function retrieve the data set without caching.

update_cache

FALSE by default. If TRUE, the cache is updated.

compress_file

TRUE by default. It compresses the RDS file in caching.

cache_dir

By default it saves the cache directory into the current working directory.

Examples

Run this code
if (FALSE) get_istatdata("12_60_DF_DCCV_CONSACQUA_2" , 
                                  start_period = 2015, 
                                  end_period = 2018, 
                                  cache = FALSE)

Run the code above in your browser using DataLab