attach_consonance: attach a consonance object to an existing model

Description Usage Arguments Value Examples

View source: R/attach.R

Description

attach a consonance object to an existing model

Usage

1
attach_consonance(object, suite)

Arguments

object

list-like object, for example a lm or glm model

suite

object of class consonance_suite

Value

list-like object with a consonance component

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# create a regression model and a suite of tests
xy <- data.frame(x=1:10, y=1:10)
xy.lm <- lm(y~x, data=xy)
suite <- consonance_suite() +
   consonance_test("x numeric", is.numeric, .var="x")
xy.model <- attach_consonance(xy.lm, suite)

# preview that the test suite is attached to the model
xy.model$consonance

# use the model as-if it were a test suite
validate(xy, xy.model)

tkonopka/consonance documentation built on Oct. 9, 2020, 2:09 p.m.