custom_validate: Customize validation components

View source: R/validate.R

custom_validateR Documentation

Customize validation components

Description

custom_validate() makes it easy to customize what validation components should be included during IDF object modifications using ⁠$dup()⁠, ⁠$add()⁠, ⁠$set()⁠ and other methods in Idf class.

Usage

custom_validate(
  required_object = FALSE,
  unique_object = FALSE,
  unique_name = FALSE,
  extensible = FALSE,
  required_field = FALSE,
  auto_field = FALSE,
  type = FALSE,
  choice = FALSE,
  range = FALSE,
  reference = FALSE
)

Arguments

required_object

Check if required objects are missing in current model. Default: FALSE.

unique_object

Check if there are multiple objects in one unique-object class. Default: FALSE.

unique_name

Check if all objects in every class have unique names. Default: FALSE.

extensible

Check if all fields in an extensible group have values. Default: FALSE.

required_field

Check if all required fields have values. Default: FALSE.

auto_field

Check if all fields with value "Autosize" and "Autocalculate" are valid or not. Default: FALSE.

type

Check if all fields have values with valid types, i.e. character, numeric and integer fields should be filled with corresponding type of values. Default: FALSE.

choice

Check if all choice fields have valid choice values. Default: FALSE.

range

Check if all numeric fields have values within defined ranges. Default: FALSE.

reference

Check if all fields whose values refer to other fields are valid. Default: FALSE.

Details

There are 10 different validation check components in total. Three predefined validation level are included, i.e. "none", "draft" and "final". To get what validation components those levels contain, see level_checks().

Value

A named list with 10 elements.

Examples

custom_validate(unique_object = TRUE)

# only check unique name during validation
eplusr_option(validate_level = custom_validate(unique_name = TRUE))

eplusr documentation built on Aug. 25, 2023, 5:18 p.m.