Learn R Programming

valdr (version 2.0.0)

.safe_extract: Safely extract a field from a list of lists

Description

Internal helper function used to extract a specified field from a list of records. If a field value is NULL, it is replaced with an empty string ("").

Usage

.safe_extract(x, field)

Value

A character vector containing the extracted values, with NULLs replaced by "". Internal function (not designed to be used directly by end users)

Arguments

x

A list of lists (records), coming from parsed JSON API responses.

field

A character string naming the field to extract from each record.