unbox_list_elements: Unlist all list elements of length 1 if they are not a list

View source: R/utils-query.R

unbox_list_elementsR Documentation

Unlist all list elements of length 1 if they are not a list

Description

This function wraps a simple modify_if function to "unbox" list elements. This is helpful when the as_list returns elements of XML and the element value is kept as a list of length 1, even though it could be a single primitive data type (e.g. logical, character, etc.).

Usage

unbox_list_elements(x)

Arguments

x

list; a list to be cleaned.

Value

list containing NA in place of NULL element values.

Note

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


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