Learn R Programming

climatehealth (version 1.0.0)

check_file_extension: Check that a file extension on a given path matches the expected.

Description

This function takes an expected file extension, and validates it against a user-inputted file path.

Usage

check_file_extension(fpath, expected_ext, param_nm = "fpath", raise = TRUE)

Value

Whether or not the passed file has a valid file extension.

Arguments

fpath

The filepath.

expected_ext

The expected file extension.

param_nm

The parameter name that the filepath was passed to (for error raising), Default: 'fpath'

raise

Whether or not to raise an error, Default: TRUE