| distortion_functions | R Documentation |
These are functions that build a pattern that can be used as the distort
argument in arrow geoms. They produce one 'oscillation' that will be repeated
to distort a line.
distort_sinewave(length = 4, width = 2, n = 30L)
distort_sawtooth(length = 4, width = 2)
distort_squarewave(length = 4, width = 2)
length |
A positive |
width |
A |
n |
An |
It is possible to write your own distort_*() function. The assumption
is that an oscillation starts at the (0, 0) coordinate and ends at the
(length, 0) coordinate.
The exact length of an oscillation will be fitted based on the arc-length of the path it will be placed on. If the arc-length will not accommodate an exact integer number of oscillations, the oscillations will be stretched to cover the whole arc-length.
A <matrix[n, 2]> with x and y columns describing a path.
It may have a size attribute.
distort_sinewave(): Follows a sine waveform.
distort_sawtooth(): Follows a triangular waveform.
distort_squarewave(): Follows a square waveform.
plot(distort_sinewave(), type = 'l')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.