filter_file_names: Takes a path or vector of paths and filters either using a...

Description Usage Arguments Details Value

Description

Filter a path for DHS data file name elements. Returns true for path items that match the requested elements and false for those that don't. The match considers the position of the element in the filename so it's not a straight regex.

Usage

1
filter_file_names(path, pattern = NULL, latest = FALSE, ...)

Arguments

path

path or vector of paths to files to filter out.

either

NULL (for code based filtering) or a regex to be used to filter out elements of the path.

Details

To avoid situations with unreliable filtering (e.g.-try typing "Lao People's Democratic Republic" reliably/repeatedly) this function relies on the DHS codes for countries, data formats, etc... to get these use the functions 'get_country_code', 'get_dataset_type_code', 'get_file_format_extensions', 'get_file_format_code'. Those functions to loose string matching via regex.

Value

paths matching the conditions or a length-zero character vector.


sakrejda/pdhs documentation built on May 28, 2019, 9:51 a.m.