get_dataset: Get dataset archive

Description Usage Arguments Value See Also Examples

View source: R/get_dataset.R

Description

This is the API wrapper function for the getDataset operation. It retrieves the ZIP archive of the requested session dataset, then unzip the content to a specified local directory.

Usage

1
2
get_dataset(dataset_list, save_to_dir = ".",
  api_key = legiscan_api_key())

Arguments

dataset_list

List object returned from get_dataset_list

save_to_dir

Local directory to save the unzipped dataset. Default to working directory "."

api_key

Your LegiScan API key (see legiscan_api_key)

Value

NULL. No return value. Dataset will be unzipped to local disk.

See Also

get_dataset_list, legiscan_api_key, LegiScan API manual.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# One dataset
get_dataset(one_dataset, save_to_dir = "data_json")

# Multiple datasets. Use walk() to avoid printing NULL to console.
# But lapply() and map() works too
walk(multiple_datasets, get_dataset, save_to_dir = "data_json")

## End(Not run)

fanghuiz/legiscanrr documentation built on Jan. 13, 2020, 4:51 a.m.