Documentation

narrow_passes()

Description

Adds a column called cydr_NarrowPassError to a dataframe to identify observations associated with narrow passes.

Will identify all observations within narrow passes as erroneous. A pass is deemed narrow if it has an average yield less than 1-diff times that of either its neighbours.

Usage

narrow_passes(data, remove=FALSE, passColumn=NULL, diff=0.15)

Arguments

Argument Description
data a data frame standardized and outputted from AgLeader.
remove a boolean. Defaults to FALSE. Indicates whether to remove identified errors.
passColumn a string or NULL. Defaults to NULL. Indicates what column specifies an observation’s pass number. If NULL the built-in helper function number_passes() will be used to assign pass numbers to each observation.
diff a numeric value between 0 and 1. Defaults to 0.15. Determines the allowable relative difference between neighbouring passes.

Value

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

Examples

narrow_passes(data)
narrow_passes(data, remove=TRUE, diff=0.25) # Allows differences of up to 25%
narrow_passes(data, passColumn="Pass_Num") # Will use Pass_Num to number passes as th

passend_turns()

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

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

Arguments

Argument Description
data a data frame 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 data frame with an added column called cydr_PassEndError. This column will be set to TRUE if it meets the criteria for an erroneous observation.

Examples

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.

speed()

Description

Adds a column called cydr_SpeedError to a dataframe to identify observations associated with outlying speeds.

Will identify all observations with speeds greater than sd standard deviations from the mean. If remove is TRUE all erroneous observations will be removed from the dataframe.

Usage

speed(data, remove=FALSE, type=“both”, sd=2)

Arguments

Argument Description
data a data frame standardized and outputted from AgLeader
remove a boolean. Defaults to FALSE. Indicates whether to remove identified errors.
type one of “high”, “low”, or “both”. Determines which types of data to identify as erroneous. “high” will identify fast speeds, “low” will identify slow speeds, and “both” will identify data associated with either fast or slow speeds.
sd a number >= 0. Defaults to 2. Used as the standard deviation threshold for error identification.

Value

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

If remove = TRUE all observations cydr identifies as erroneous are removed from the returned dataframe.

Examples

speed(data)
speed(data, type="both")
speed(data, FALSE, type="low")
speed(data, TRUE, type="high")

residual_outliers()

Description

Adds a column called cydr_ResidualError to a data frame to identify observations associated with outlying yields.

Will identify all observations with yields greater than sd standard deviations away from the mean. If remove is TRUE all observations associated with a residual error will be removed from the data frame.

Usage

residual_outliers(data, remove=FALSE, type=“both”, sd=2)

Arguments

Argument Description
data a data frame standardized and outputted from AgLeader
remove a boolean. Defaults to FALSE. Indicates whether to remove identified errors.
type one of “high”, “low”, or “both”. Determines which types of data to identify as erroneous. “high” will identify fast speeds, “low” will identify slow speeds, and “both” will identify data associated with either fast or slow speeds.
sd a number >= 0. Defaults to 2. Used as the standard deviation threshold for error identification.

Value

A data frame with an added column called cydr_ResidualError. This column will be set to TRUE if an observation is deemed erroneous.

If remove = TRUE all observations cydr identifies as erroneous are removed from the returned data frame.

Examples

residual_outliers(data)
residual_outliers(data, TRUE)
residual_outliers(data, TRUE, type="low", sd=3)