newknots | R Documentation |
Non-exported function, newknots
are used in the cpr
and
cnr
calls. Used to create a new control polygon or control net
from with different internal knots.
newknots(form, nk)
form |
a |
nk |
numeric vector, or a list of numeric vectors, to be used in a
|
Think of this function as an analogue to the stats{update}
calls. Where stats{update}
will modify a call
, the
newknots
will update just the iknots
argument of a
bsplines
or btensor
call within the formula
argument of
a cp
or cn
call.
Expected use is within the cpr
and cnr
calls. The
return object a formula to define a control polygon/net
with different knots than then ones found within form
.
update_bsplines
for a more generic tool for the end
user.
cp0 <- cp(log(pdg) ~ bsplines(day, iknots = c(-.25, 0, 0.25), bknots = c(-1, 1)), data = spdg)
new_knots <- c(-0.85, 0, 0.25, 0.3)
f <- cpr:::newknots(cp0$call$formula, nk = new_knots)
f
cp(f, data = spdg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.