Skip to contents

Returns the number of presence rows (nrow(env_occ)) that were passed to optimize_niche. This is the sample size used by BIC and is the conventional choice for the presence-only and weighted families: even though the weighted likelihood includes a denominator over background points, the observed quantities being modeled are the \(n_{occ}\) occurrences.

Usage

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

Arguments

object

A "xnicher" object.

...

Ignored.

Value

Integer scalar.

Examples

# \donttest{
fit <- optimize_niche(env_occ = example_env_occ_2d,
                      env_m   = example_env_m_2d,
                      num_starts = 5L, likelihood = "weighted")
nobs(fit)
#> [1] 73
# }