R/nobs.R

Defines functions nobs nobs.default nobs.data.frame

Documented in nobs nobs.data.frame nobs.default

# $Id: nobs.R 1799 2014-04-05 18:38:23Z warnes $

## Redefine here, so that the locally defined methods (particularly
## nobs.default) take precidence over the ones now defined in the
## stats package
nobs <- function(object, ...)
  UseMethod("nobs")

nobs.default <- function(object, ...)
  {
    if(is.numeric(object) || is.logical(object))
      sum( !is.na(object) )
    else
      stats::nobs(object, ...)
  }


nobs.data.frame <- function(object, ...)
  sapply(object, nobs.default)

## Now provided by 'stats' package, so provide alias to satisfy
## dependencies
nobs.lm <- stats:::nobs.lm

Try the gdata package in your browser

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

gdata documentation built on May 2, 2019, 5:49 p.m.