View source: R/03-summary-statistics.R
validate_transformation | R Documentation |
Routine for checking whether a given transformation is valid.
validate_transformation(...)
## S3 method for class 'aghqtrans'
validate_transformation(trans, checkinverse = FALSE, ...)
## S3 method for class 'list'
validate_transformation(translist, checkinverse = FALSE, ...)
## Default S3 method:
validate_transformation(...)
... |
Used to pass arguments to methods. |
trans |
A transformation object of class |
checkinverse |
Default |
translist |
A list. Will be checked, passed to |
This function checks that:
The supplied object contains elements totheta
, fromtheta
, and jacobian
, and that they are all functions,
If checkinverse
is a vector of numbers, then it checks that totheta(fromtheta(checkinverse)) == checkinverse
.
In addition, if a list
is provided, the function first checks that it contains the right elements,
then passes it to make_transformation
, then checks that.
This function throws an informative error messages when checks don't pass or themselves throw errors.
TRUE
if the function runs to completion without throwing an error.
Other transformations:
default_transformation()
,
make_transformation()
t <- make_transformation(log,exp)
validate_transformation(t)
t2 <- list(totheta = log,fromtheta = exp)
validate_transformation(t2)
## Not run:
t3 <- make_transformation(log,log)
checkvals <- exp(exp(rnorm(10)))
# Should throw an informative error because log isn't the inverse of log.
validate_transformation(t3,checkinverse = checkvals)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.