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

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".

Value

A vector of paths to local json file

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.

Examples

# NOT RUN {
find_json_path(base_dir = "data", "bill")
find_json_path(base_dir = "data", "vote")
# }