Description Usage Arguments Details Value See Also Examples

View source: R/pointssegment.r

This function calculates intermediate points between two points. The intermidate points can be jittered and smoothed with a Bezier curve.

1 2 | ```
pointssegment(xbegin, ybegin, xend, yend,
npoints = 10, xjitteramount= 0, yjitteramount=0, bezier = TRUE)
``` |

`xbegin` |
A numeric value. Coordinate x of the point from which to interpolate. |

`ybegin` |
A numeric value. Coordinate y of the point from which to interpolate. |

`xend` |
A numeric value. Coordinate x of the point to which to interpolate. |

`yend` |
A numeric value. Coordinate y of the point to which to interpolate. |

`npoints` |
Number of points (including the limits). |

`xjitteramount, yjitteramount` |
Numeric. Amount of jitter. |

`bezier` |
Logical. Use or not the Bezier curves to smooth the jittered data. |

It calculates the intermediate points between two points. If there are no jitter amounts, then there are no interpolations.

By default, the data are smoothed using a Bezier curve. It gives 30 points.

A data frame with the interpolated values.

1 2 3 4 5 | ```
plot(pointssegment(xbegin=0, ybegin=0, xend=10, yend=10))
plot(pointssegment(xbegin=0, ybegin=0, xend=10, yend=10,
xjitteramount=2,yjitteramount=2))
plot(pointssegment(xbegin=0, ybegin=0, xend=10, yend=10,
xjitteramount=2,yjitteramount=2,bezier=FALSE))
``` |

xkcd documentation built on May 31, 2017, 2:07 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.