custom_validate {eplusr} | R 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: |
unique_object |
Check if there are multiple objects in one unique-object
class. Default: |
unique_name |
Check if all objects in every class have unique names.
Default: |
extensible |
Check if all fields in an extensible group have values.
Default: |
required_field |
Check if all required fields have values. Default:
|
auto_field |
Check if all fields with value |
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: |
choice |
Check if all choice fields have valid choice values. Default:
|
range |
Check if all numeric fields have values within defined ranges.
Default: |
reference |
Check if all fields whose values refer to other fields are
valid. Default: |
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))