validate (version 0.9.3)

meta: Get or set rule metadata

Description

Rule metadata are key-value pairs where the value is a simple (atomic) string or number.

Usage

meta(x, ...)

meta(x, name) <- value

# S4 method for rule meta(x, ...)

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

# S4 method for expressionset meta(x, simplify = TRUE, ...)

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

Arguments

x

an R object

...

Arguments to be passed to other methods

name

[character] metadata key

value

Value to set

simplify

Gather all metadata into a dataframe?

See Also

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

Examples

Run this code
# NOT RUN {
v <- validator(x > 0, y > 0)

# metadata is recycled over rules
meta(v,"foo") <- "bar" 

# assign metadata to a selection of rules
meta(v[1],"fu") <- 2

# retrieve metadata as data.frame
meta(v)

# retrieve metadata as list
meta(v,simplify=TRUE)

# }

Run the code above in your browser using DataCamp Workspace