teal.data
classes that accumulate raw data accept a
boolean check
argument, e.g. [teal_data()]. This boolean
flag indicates whether teal
performs validation of the data
passed to the TealData
object during launch of a
teal
application.
The validation compares the raw data passed to the class with the dataset returned by the code stored in the class. E.g.:
library(teal.data)
<- dataset("iris", iris, code = "iris <- iris")
iris_ds <- teal_data(iris_ds, check = TRUE)
data $check() # returns TRUE data
The check()
method called during launch can be invoked
directly and returns TRUE
if the raw data passed to
teal_data
matches the return value of the code stored in
the class. It returns an error if the comparison fails and
NULL
if the check = FALSE
was passed to
teal_data
.
# throws an error:
# Error in x$check_reproducibility() : Reproducibility check failed.
<- teal_data(dataset("iris", iris, code = "iris <- mtcars"), check = TRUE)
data
<- teal_data(dataset("iris", iris, code = "iris <- mtcars"), check = FALSE)
data $check() # returns NULL even though the code does not match the raw data data
Find out more in the teal_data()
documentation.
<x>_connector
objects do not accept raw data as
input and therefore are not checked even if check = TRUE
is
used.