R/check_format_tests.R

Defines functions check_format_tests

Documented in check_format_tests

#' Checks the output of functions format_test
#'
#' Checks the output of function \code{\link{format_tests}}.
#'
#' @param  x Result of function \code{format_tests}.
#' @return \code{TRUE} if \code{x} has the following properties:
#' \code{x} is a data.frame with exactly one row and with unique colnames. Else throws an error.
#'
check_format_tests <- function(x) {
    stopifnot(is.data.frame(x), nrow(x) == 1, ncol(x) > 0, anyDuplicated(colnames(x)) ==
        0, sapply(x, is.atomic))

    return(TRUE)
}

Try the atable package in your browser

Any scripts or data that you put into this service are public.

atable documentation built on Sept. 17, 2023, 5:06 p.m.