getOptionalValue: Get an optional value from data, using a default if not present
Description
Use this function for optional fields where no warning should be generated if missing.
Usage
getOptionalValue(data, field_name, default_value = NA)
Value
The field value if it exists, otherwise the default_value
Arguments
- data
The data structure to extract from
- field_name
The name of the field to extract
- default_value
Value to return if the field doesn't exist