casewhen: Generate a SQL CASE statement from a mapping file
Description
This function constructs a CASE..WHEN,,THEN statement from a mapping file or
dataframe. It assumes that the first column of the mapping data contains the
original WHEN values, and the second column contains the THEN values (the
values to be mapped to.)
Usage
casewhen(inputfile = NULL, header = FALSE)
Value
A string that represents the constructed CASE statement
Arguments
inputfile
Mapping dataframe OR path to the mapping file
header
If reading a csv file, TRUE if the file includes a header row,
FALSE if it does not include a header row.