Learn R Programming

universals (version 0.0.1)

npars: Number of Parameters

Description

Gets the number of parameters of an object.

The default methods returns the length of pars() if none are NA, otherwise it returns NA.

Usage

npars(x, ...)

# S3 method for default npars(x, ...)

Arguments

x

An object.

...

Other arguments passed to methods.

Value

An integer scalar of the number of parameters.

See Also

pars()

Other MCMC dimensions: nchains(), niters(), nsams(), nsims(), nterms()

Other parameters: pars(), set_pars()

Examples

Run this code
# NOT RUN {
npars.foobar <- function(x, ...) {
  length(pars(x, ...))
}
# }

Run the code above in your browser using DataLab