Learn R Programming

durmod (version 1.1-4)

flatten: Convert a structured coefficient set to a vector

Description

mphcrm stores coefficients in a list, not in a vector. This is because they should be treated differently according to whether they are probabilities, proportional hazards, or coefficients for factor levels or ordinary covariates. flatten extracts them as a named vector. unflatten puts them back in structured form.

Usage

flatten(x, exclude = attr(x, "exclude"))

unflatten( flesh, skeleton = attr(flesh, "skeleton"), exclude = attr(flesh, "exclude") )

Arguments

x

parameter set as typically found in opt[[1]]\$par, where opt is returned from mphcrm.

exclude

For internal use

flesh

vector of class "relistable", as returned from flatten.

skeleton

For internal use

Details

flatten/unflatten is just a thinly disguised unlist/relist, but uses slightly more readable names.