R/check_numeric.R

Defines functions check_numeric

Documented in check_numeric

#' Check numeric
#' 
#' Ensure that a matrix is numeric. If not, it will be converted to numeric.
#' @param exp Input matrix.
#' @return Numeric expression matrix.
#' 
#' @keywords internal
#' @importFrom methods is
check_numeric <- function(exp) {
    if (methods::is(exp[1, 1], "character")) {
        storage.mode(exp) <- "numeric"
    }
    return(exp)
}
NathanSkene/EWCE documentation built on Nov. 3, 2024, 8:16 a.m.