Nothing
#' Checks validity of variables' matrix
#'
#' Checks whether the matrix is numeric,
#' has expected number of columns (\code{ncol}),
#' and has no missing/infinite data.
#'
#'
#' @param var Matrix N x ncol
#' @param var_label Variable label for error messages
#' @return Logical TRUE, if none of the tests fail
#' @keywords internal
#' @export
#'
#' @examples
#' check_variables(matrix(c(1, 2, 3, 4), ncol=2), "test matrix")
check_variables <- function(var, var_label){
if (!is.numeric(var)) stop(sprintf("%s is not a numeric", var_label))
if (sum(!is.finite(var)) > 0) stop(sprintf("%s has non-finite elements", var_label))
TRUE
}
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.