R/is_shape_array.R

Defines functions is_shape_array

Documented in is_shape_array

#' Helper function to check if input is array of right dimensions for shape analyses
#'
#' @param x
#'
#' @return TRUE or FALSE
#' @keywords internal
#'
is_shape_array <- function(x) {
  # Anything else this should be checking for?
  if (is.array(x) &&
      length(dim(x)) == 3 &&
      (dim(x)[[2]] == 2 | dim(x)[[2]] == 3)){
    return(TRUE)
  } else {
    return(FALSE)
  }
}
iholzleitner/facefuns documentation built on March 19, 2021, 2:43 p.m.