knot_expr: Knot Expressions

View source: R/knot_expr.R

knot_exprR Documentation

Knot Expressions

Description

Non-exported function used to build expressions for the knot sequences to be labeled well on a plot.

Usage

knot_expr(x, digits)

Arguments

x

a cpr_cp or cpr_bs object

digits

digits to the right of the decimal point to report

Value

a list

Examples


bmat <- bsplines(mtcars$hp, df = 8, bknots = c(50, 350))
ke <- cpr:::knot_expr(bmat, digits = 1)
summary(ke)

plot(x = ke$breaks, y = rep(1, length(ke$breaks)), type = "n")
text(
       x = ke$breaks
     , y = rep(1, length(ke$breaks))
     , labels = parse(text = ke$xi_expr)
)


dewittpe/cpr documentation built on Feb. 16, 2024, 1:11 p.m.