Learn R Programming

istat (version 1.1.1)

get_i_stat: Download data sets by id (source: I.Stat)

Description

Download data sets from I.Stat (old ISTAT provider). Alternatively, use get_istatdata to download data sets from IstatData (new ISTAT provider). The parameters "id_dataset" to download data sets can be found using list_i_stat function or search_i_stat function.

Usage

get_i_stat(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 the 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_i_stat("12_60", 
                              start_period=2015, 
                              end_period=2018, 
                              lang = "eng", 
                              cache = FALSE)

Run the code above in your browser using DataLab