findRotation: Find Rotation Factor For Plot

Description Usage Arguments Value Examples

Description

Given (x,y) of the left-most and bottom-most points in a dataframe, find the angle required to rotate the plot to be straight. This function will return the degrees of rotation required to turn a plot straight. Specifically, it converts these two points into polar coordinates, then subtracts the angle of their interaction from 360 degrees. Used primarily within other functions like rotatePlot.

Usage

1
findRotation(xleft, yleft, xbot, ybot)

Arguments

xleft

The x value of the leftmost point.

yleft

The y value of the leftmost point.

xbot

The x value of the bottommost point.

ybot

The y value of the bottommost point.

Value

This function returns a single numeric value representing the conversion factor needed to straighten a plot based on its leftmost and bottommost points. In essence, if the leftmost point is above the bottommost point in space, it will rotate counter clockwise until the y's of each point are equal. If they are already equal, no conversion will occur.

Examples

1
2
findRotation(0,0,1,-1)
findRotation(0,2,0,0)

ecology-rocks/disperseR documentation built on May 15, 2019, 7:58 p.m.