Nothing
#' @importFrom methods new
#' @exportMethod ifelse
setMethod("ifelse",
signature(test = "magpie"),
function(test, yes, no) {
if (!all(suppressWarnings(as.integer(test)) %in% c(0, 1))) {
stop("'test' must only contain booleans!")
}
yes <- test * yes
no <- (1 - test) * no
yes[!test] <- 0
no[test] <- 0
return(yes + no)
}
)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.