nCovars - Number of covariates
Return number of covariates in a distance model
nCovars(X)
X
An integer scalar
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.
Useful links