sine: Animate sine path

View source: R/curve-shape.R

sineR Documentation

Animate sine path

Description

This function creates a path from the starting point (x_start, y_start) to the ending point (x_end, y_end) with the sine shape.

Usage

sine(x_start = 0, x_end = 1, y_start = 0, y_end = 1, n = 100)

Arguments

x_start

The x-coordinate of the starting point.

x_end

The x-coordinate of the ending point.

y_start

The y-coordinate of the starting point.

y_end

The y-coordinate of the ending point.

n

A numeric value that controls the number of points between starting and ending points.

Value

Return a path in a data frame format

References

Brunson JC (2020). “ggalluvial: Layered Grammar for Alluvial Plots.” Journal of Open Source Software, 5(49), 2017. doi:10.21105/joss.02017.

Examples

path <- sine()

ggplot2::ggplot(data = path, ggplot2::aes(x = x, y = y)) + ggplot2::geom_point()


animbook documentation built on June 22, 2024, 7:14 p.m.