pass_end_turns: Identify pass-end turns

Description Usage Arguments Value See Also Examples

Description

Adds a column called cydr_PassEndError to a dataframe to identify observations occurring within pass-end turns. These observations are identified by comparing two pairs of points occurring before and after the point of interest. If the difference in direction between both pairs of points is above their respective thresholds, the observation is identified as pass-end turn error.

The first pair identifies whether the point is within a "short-turn", by default checking if the points 5 before and 5 after have a difference in direction equal to or greater than 45 degrees. The second pair identifies whether the point is within a "long-turn", by default checking whether the points 20 before and 20 after have a difference in direction of 178 degrees or greater.

The thresholds used to determine short- and long-turns can all be customized using the provided arguments.

Usage

1
pass_end_turns(data, remove=FALSE, short_angle=45, long_angle=178, short_offset =5, long_offset=20)

Arguments

data

a dataframe standardized and outputted from AgLeader.

remove

a boolean. Defaults to FALSE. Indicates whether to remove identified errors.

short_angle

a number between 0 and 180. Defaults to 45. Used as the angle to determine whether an observation is within a short-turn. If the difference between compared points is greater than this angle, a short-turn is identified.

long_angle

a number between 0 and 180. Defaults to 178. Used as the angle to determine whether an observation is within a long-turn. If the difference between compared points is greater than this angle, a long-turn is identified.

short_offset

a number greater than 0 such that short_offset < long_offset. Defaults to 5. Used to determine the pair of numbers which will be compared to determine whether a short-turn is occurring. For example, a short_offset of 5 will compare the point 5 prior and the point 5 past the point of interest. If the difference in these points' directions is greater than short_angle, a short-turn is occurring.

long_offset

a number greater than 0 such that short_offset < long_offset. Defaults to 20. Used to determine the pair of numbers which will be compared to determine whether a long-turn is occurring. For example, a long_offset of 20 will compare the point 20 prior and the point 20 past the point of interest. If the difference in these points' directions is greater than long_angle, a long-turn is occurring.

Value

A dataframe with an added column called cydr_PassEndError. This column will be set to TRUE if it meets the criteria for an erroneous observation.

See Also

Other core functions: narrow_passes, residual_outliers, speed

Examples

1
2
3
4
pass_end_turns(data)
pass_end_turns(data, remove=TRUE) # Removes all identified errors
pass_end_turns(data, long_angle=170) # Identifies differences in long_offset points 
of > 170 as erroneous. 

jillianderson8/cydr documentation built on May 19, 2019, 10:31 a.m.