AIC).
nobs(object, ...)
"nobs"(object, use.fallback = FALSE, ...)NA.
"lm", "glm", "nls" and
  "logLik", as well as a default method (which throws an
  error, unless use.fallback = TRUE when it looks for
  weights and residuals components -- use with care!).  The main usage is in determining the appropriate penalty for BIC, but
  nobs is also used by the stepwise fitting methods
  step, add1 and drop1 as a
  quick check that different fits have been fitted to the same set of
  data (and not, say, that further rows have been dropped because of NAs
  in the new predictors).
  For lm, glm and nls fits, observations with zero
  weight are not included.
AIC.