Learn R Programming

term (version 0.1.0)

npars: Number of Parameters

Description

Gets the number of parameters of an object as returned by pars().

Usage

npars(x, ...)

# S3 method for term npars(x, scalar = NA, ...)

Arguments

x

The object.

...

Unused.

scalar

A flag specifying whether to only count parameters with one term.

Value

A count of the number of parameters.

Methods (by class)

  • term: Number of parameters of term vector

See Also

pars() and term-vector()

Examples

Run this code
# NOT RUN {
npars(as.term(c("sigma", "alpha[1]", "alpha[2]", "beta[1,1]", "beta[2,1]")))
npars(as.term(c("sigma", "alpha[1]", "alpha[2]")), scalar = TRUE)
# }

Run the code above in your browser using DataLab