Learn R Programming

Rdistance (version 4.0.5)

nCovars: nCovars - Number of covariates

Description

Return number of covariates in a distance model

Usage

nCovars(X)

Value

An integer scalar

# do not export

Arguments

X

The X matrix of covariates, or a vector.

Details

The reason this routine is needed is that sometimes we pass one row of covariates to a likelihood function. If so, it may come in as a normal vector, not a matrix. If a normal vector, ncol(X) does not work.