safe_extract {ip2location.io}R Documentation

Safe Data Extraction from API Response

Description

This function extracts the value of a given field from the parsed API response. It handles missing or empty data gracefully by returning NA if the field is missing.

Usage

safe_extract(x, field)

Arguments

x

The parsed JSON response (usually a list).

field

The name of the field to extract (as a string).

Value

The extracted field value, or NA if missing or empty.


[Package ip2location.io version 0.0.0-2 Index]