nobs.gsl_nls function

Extract the number of observations

Extract the number of observations

Returns the number of observations from a "gsl_nls" object.

## S3 method for class 'gsl_nls' nobs(object, ...)

Arguments

  • object: An object inheriting from class "gsl_nls".
  • ...: At present no optional arguments are used.

Returns

Integer number of observations similar to nobs

Examples

## data set.seed(1) n <- 25 xy <- data.frame( x = (1:n) / n, y = 2.5 * exp(-1.5 * (1:n) / n) + rnorm(n, sd = 0.1) ) ## model obj <- gsl_nls(fn = y ~ A * exp(-lam * x), data = xy, start = c(A = 1, lam = 1)) nobs(obj)

See Also

nobs

  • Maintainer: Joris Chau
  • License: LGPL-3
  • Last published: 2025-01-17