Description Usage Arguments Value Examples
Manually create data points corresponding to piecewise polynomial.
Use create_path()
to exert full control over trajectory shape. Starting
with scalar values defined by nodes
, create_path()
integrates twice to
create continuously differentiable function.
create_path()
is the underlying function to meandr()
.
If you are trying to generate random curve, it is strongly recommended to use meandr().
1 2 3 4 5 6 | create_path(
n_points = 100,
nodes = c(1, -1, -1, 2, 0),
node_int = NULL,
scale = 1
)
|
n_points |
An integer. Controls output "resolution". (Underlying calculus is unaffected). |
nodes |
A numeric vector corresponding to 2nd derivative values. This determines the overall shape of the function. |
node_int |
A numeric vector assigning x-values for nodes. Automatically placed at equal intervals if |
scale |
A number. Adjusts all y-values so that max(y) = |
A tibble containing coordinates of resulting function.
1 2 3 4 5 | # quadratic increase followed by linear slope
create_path(nodes = c(1, 0))
# resembles sinusoid
create_path(nodes = c(1, -1, 1, -1, 1), node_int = c(0, 0.125, 0.375, 0.625, 0.875))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.