R/test_combined.R

Defines functions test_combined

test_combined <- function() {
    if (is.null(h_env$combine)) return() # stop here if no combinations supplied
    combine <- unlist(h_env$combine)
    if (h_env$map_name %in% c("internal_organs")) {
        test_locs <- combine
    } else {
        test_locs <- paste0(if (h_env$body_halves == "left") "left_" else "right_", combine)
    }
    region_test <- is.na(match(test_locs, h_env$regions))
    if (any(region_test))
        stop(paste0(combine[region_test], " not valid region(s) for the specified map.",
                    collapse = " "), call. = FALSE)
}
benskov/humapr documentation built on April 3, 2021, 6:52 a.m.