check_field_exists: Check if a field exists in data and warn if it doesn't, then...

View source: R/misc.R

check_field_existsR Documentation

Check if a field exists in data and warn if it doesn't, then return the field value

Description

Check if a field exists in data and warn if it doesn't, then return the field value

Usage

check_field_exists(
  data,
  field_name,
  class_name,
  context = NULL,
  default_value = NA
)

Arguments

data

The data structure to check

field_name

The name of the field to check for

class_name

The name of the class being populated

context

Optional context information for the warning message

default_value

Value to return if the field doesn't exist (default: NA)

Value

The field value if it exists, otherwise the default_value


rmzqc documentation built on June 8, 2025, 1:59 p.m.