Learn R Programming

validate (version 1.1.5)

plot,validator-method: Plot a validator object

Description

The matrix of variables x rules is plotted, in which rules that are recognized as linear (in)equations are differently colored. The augmented matrix is returned, but can also be calculated using variables(x, as="matrix").

Usage

# S4 method for validator
plot(
  x,
  y,
  use_blocks = TRUE,
  col = c("#b2df8a", "#a6cee3"),
  cex = 1,
  show_legend = TRUE,
  ...
)

Value

(invisible) the matrix

Arguments

x

validator object with rules

y

not used

use_blocks

logical if TRUE the matrix is sorted according to the connected sub sets of variables (aka blocks).

col

character with color codes for plotting variables.

cex

size of the variables plotted.

show_legend

should a legend explaining the colors be drawn?

...

passed to image

See Also

variables

Other validator-methods: +,validator,validator-method, validator

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

Examples

Run this code
rules <- validator( r1 = staff.costs < total.costs
                  , r2 = turnover + other.rev == total.rev
                  , r3 = other.rev > 0
                  , r4 = total.rev > 0
                  , r5 = nace %in% c("A", "B")
                  )
plot(rules, cex=0.8, show_legend=TRUE)

data(retailers)
cf <- confront(retailers, rules)
plot(cf, main="Retailers check")

Run the code above in your browser using DataLab