R/rowNAs.R

Defines functions rowNAs colNAs

Documented in colNAs rowNAs

#' get NR of NA's per matrix or data.frame row
#' 
#' @param x matrix or data.frame
#' @export
rowNAs <- function(x){
  return(apply(x, 1, function(x){sum(is.na(x))}))
}
#' get NR of NA's per matrix or data.frame column
#' 
#' @param x matrix or data.frame
#' @export
colNAs <- function(x){
  return(apply(x, 2, function(x){sum(is.na(x))}))
}

Try the quantable package in your browser

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

quantable documentation built on May 2, 2019, 4:05 p.m.