newknots {cpr} | R Documentation |
New Knots for CPs and CNs in CPR and CNR
Description
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.
Usage
newknots(form, nk)
Arguments
form |
a |
nk |
numeric vector, or a list of numeric vectors, to be used in a
|
Details
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.
Value
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
.
See Also
update_bsplines
for a more generic tool for the end
user.
Examples
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)
[Package cpr version 0.4.0 Index]