merge_null_to_na: Return NA if NULL

View source: R/utils.R

merge_null_to_naR Documentation

Return NA if NULL

Description

A helper function to convert NULL values in API responses to a value of NA which is allowed in data frames. Oftentimes, a NULL value creates issues when binding and building data frames from parsed output, so we need to switch to NA.

Usage

merge_null_to_na(x)

Arguments

x

a value, typically a single element or a list to switch to NA if its value appears to be NULL.

Value

the original value of parameter x or NA if the value meets the criteria to be considered NULL.

Note

This function is meant to be used internally. Only use when debugging.


salesforcer documentation built on March 18, 2022, 6:26 p.m.