Examples for 'validate::label'


Rule label

Aliases: label label<- label,rule-method label<-,rule,character-method label,expressionset-method label<-,expressionset,character-method

Keywords:

### ** Examples


# retrieve properties
v <- validator(turnover > 0, staff.costs>0)

# number of rules in v:
length(v)
[1] 2
# per-rule
created(v)
[1] "2025-08-11 16:50:48 UTC" "2025-08-11 16:50:48 UTC"
origin(v)
            V1             V2 
"command-line" "command-line" 
names(v)
[1] "V1" "V2"
# set properties
names(v)[1] <- "p1"

label(v)[1] <- "turnover positive"
description(v)[1] <- "
According to the official definition,
only positive values can be considered
valid turnovers.
"

# short description is also printed:
v
Object of class 'validator' with 2 elements:
 p1 [turnover positive]: turnover > 0
 V2                    : staff.costs > 0
# print all info for first rule
v[[1]]
Object of class rule.
 expr       : turnover > 0 
 name       : p1 
 label      : turnover positive 
 description: 
According to the official definition,
only positive values can be considered
valid turnovers.
 
 origin     : command-line 
 created    : 2025-08-11 16:50:48
 meta       : language<chr>, severity<chr>
# retrieve properties
v <- validator(turnover > 0, staff.costs>0)

# number of rules in v:
length(v)
[1] 2
# per-rule
created(v)
[1] "2025-08-11 16:50:48 UTC" "2025-08-11 16:50:48 UTC"
origin(v)
            V1             V2 
"command-line" "command-line" 
names(v)
[1] "V1" "V2"
# set properties
names(v)[1] <- "p1"

label(v)[1] <- "turnover positive"
description(v)[1] <- "
According to the official definition,
only positive values can be considered
valid turnovers.
"

# short description is also printed:
v
Object of class 'validator' with 2 elements:
 p1 [turnover positive]: turnover > 0
 V2                    : staff.costs > 0
# print all info for first rule
v[[1]]
Object of class rule.
 expr       : turnover > 0 
 name       : p1 
 label      : turnover positive 
 description: 
According to the official definition,
only positive values can be considered
valid turnovers.
 
 origin     : command-line 
 created    : 2025-08-11 16:50:48
 meta       : language<chr>, severity<chr>

[Package validate version 1.1.1 Index]