Learn R Programming

validate (version 1.1.5)

names<-,rule,character-method: Extract or set names

Description

Extract or set names

When setting names, values are recycled and made unique with make.names

Get names from confrontation object

Usage

# S4 method for rule,character
names(x) <- value

# S4 method for expressionset names(x)

# S4 method for expressionset,character names(x) <- value

# S4 method for confrontation names(x)

Value

A character vector

Arguments

x

An R object

value

Value to set

See Also

Other expressionset-methods: as.data.frame(), as.data.frame,expressionset-method, created(), description(), label(), meta(), origin(), plot,validator-method, summary(), variables(), voptions()

Other validation-methods: aggregate,validation-method, all,validation-method, any,validation-method, barplot,validation-method, check_that(), compare(), confront(), event(), plot,validation-method, sort,validation-method, summary(), validation-class, values()

Examples

Run this code

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

# number of rules in v:
length(v)

# per-rule
created(v)
origin(v)
names(v)

# 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

# print all info for first rule
v[[1]]



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

# number of rules in v:
length(v)

# per-rule
created(v)
origin(v)
names(v)

# 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

# print all info for first rule
v[[1]]


Run the code above in your browser using DataLab