find_json_path: Find local JSON files

Description Usage Arguments Details Value Examples

View source: R/find_json_path.R

Description

Helper function to find paths to json files saved locally, before using the various parsing functions in this package to process the data.

Usage

1
find_json_path(base_dir, file_type)

Arguments

base_dir

Character vector of the directory where the json files are stored locally

file_type

Character. Accepts "bill", "people", "vote", or "text".

Details

Note: This function determines file type ("bill", "people", "vote", or "text") by looking at sub-directories, thus the json files will need to be saved in the approriate folder, e.g. bill json files need to be saved as xxx/bill/file.json, vote json files will need to be saved as xxx/vote/file.json. This should not be a problem if the files are unzipped directly from LegiScan bulk dataset.

Value

A vector of paths to local json file

Examples

1
2
3
4
5
## Not run: 
find_json_path(base_dir = "data", "bill")
find_json_path(base_dir = "data", "vote")

## End(Not run)

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