Function that generates knot locations. An example of usefulness of this funciton
would be with generation of interrupted time series data. Another application may
be with simulation of piecewise linear data structures.
Usage
sim_knot(var, knot_locations, right = FALSE)
Arguments
var
Variable used to create knots in the data.
knot_locations
The locations to create knots. These need to be specified
with the scale of the variable in mind. See examples.
right
logical, indicating if the intervals should be closed on the right
(and open on the left) or vice versa. See cut for more details.
Defaults to FALSE, which is likely most desirable behavior in this context.