R/utils.R

Defines functions tratar_vazio

tratar_vazio <- function(x) {
  classe <- class(x)
  if (classe[1] == "tbl_df") {
    if (nrow(x) == 0) {
      x <- tibble::tibble(arquivos = list(NA_character_))
    }
  } else if(length(x) == 0 ){
    x <- NA_character_
  } else if (is.na(x) | is.null(x)) {
    x <- NA_character_
  }

  x
}
beatrizmilz/ComitesBaciaSP documentation built on March 23, 2024, 10:36 a.m.