pipe_test | R Documentation |
magrittr
pipeTo run a test in magrittr
pipeline
pipe_test(obj, test, value = TRUE, tolerance = NULL)
obj |
An |
test |
The test |
value |
the value that the test should be equal to |
tolerance |
The tolerance for equality. Set to 0 exact (identical) equality |
obj
– the original first parameter passed to
pipe_test
data(mtcars)
mtcars.DT <- as.data.table(mtcars)
mtcars.DT %>%
.[, cyl := as.character(cyl)] %>%
pipe_test(test = class(.[["cyl"]]), value = "character")
## Or
mtcars.DT %>%
.[, cyl := as.character(cyl)] %>%
pipe_test(class(.[["cyl"]]) == "character")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.