Skip to contents

Obtain the knots from a broken stick model

Usage

get_knots(
  object,
  what = c("all", "internal", "boundary", "dropfirst", "droplast")
)

Arguments

object

An object of class brokenstick

what

A character vector of length 1. Valid values are "all", "internal", "boundary", "dropfirst" or "droplast". The default is what = "all".

Value

A vector with knot locations, either both, internal only or boundary only. The result is NULL if object does not have proper class. Returns numeric(0) if there are no internal knots.

Examples

get_knots(fit_200, "internal")
#> [1] 0.0833 0.1667 0.2500 0.5000 0.7500 1.0000 1.2500 1.5000 2.0000