For numeric vectors, this is simply the number of non-NA elements, as computed by
sum(!is.na(object)).
For dataframe objects, the result is a vector containing the
number of non-NA elementes of each column.
The nobs and nobs.lm functions defined in gtools are
simply aliases for the functions in the base R stats package,
provided for backwards compatibility.