R/utils.equal.dim.R

Defines functions equal.dim.matrix equal.dim.data.frame equal.dim.character equal.dim

#' @export
equal.dim <- function(x,y) {
  UseMethod("equal.dim")
}

#' @export
equal.dim.character <- function(x,y){
 return(length(x) == length(y))
}



#' @export
equal.dim.data.frame <- function(x,y){
  filas = F
  col = F
  if (nrow(x) == nrow(y)) filas = T
  if (ncol(x) == ncol(y)) col = T
  return(filas & col)
}

#' @export
equal.dim.matrix <- function(x,y){
  return(equal.dim.data.frame(as.data.frame(x),as.data.frame(y)))
}
feranpre/feR documentation built on Nov. 22, 2022, 2:29 a.m.