pipe_test: Test in a 'magrittr' pipe

View source: R/pipe_test.R

pipe_testR Documentation

Test in a magrittr pipe

Description

To run a test in magrittr pipeline

Usage

pipe_test(obj, test, value, tolerance = NULL)

Arguments

obj

An R object. When used in a magrittr, this will be omitted. This will also be returned

test

The test

value

the value that the test should be equal to

tolerance

The tolerance for equality. Set to 0 exact (identical) equality

Value

obj – the original first parameter passed to pipe_test

Examples

data(mtcars)
mtcars.DT <- as.data.table(mtcars)
mtcars.DT %>%
 .[, cyl := as.character(cyl)] %>%
 pipe_test(test = class(.[["cyl"]]), value = "character")


ChandlerLutz/CLmisc documentation built on Dec. 2, 2022, 12:40 p.m.