#' Title
#'
#' @param x numeric number
#'
#' @return the log transformation of x
#' @export
#'
#' @examples
#' set.seed(2)
#' (y = lapply(runif(2,-10,10), log_3))
#' y[[1]]$invalid_input
log_3 = function(x){
if(x > 0){
log(x)
}else{
rlang::catch_cnd(rlang::abort(message = "negative input and NA introduced!",
.subclass ="invalid_input",
invalid_input = x))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.