R/jbd_coordinates_precision.R
jbd_coordinates_precision.Rd
This function flags occurrences where BOTH latitude and longitude values are rounded. This contrasts with the original function, bdc::bdc_coordinates_precision() that will flag occurrences where only one of latitude OR longitude are rounded. The BeeBDC approach saves occurrences that may have had terminal zeros rounded in one coordinate column.
jbd_coordinates_precision(
data,
lat = "decimalLatitude",
lon = "decimalLongitude",
ndec = NULL,
quieter = FALSE
)
A data frame or tibble. Occurrence records as input.
Character. The name of the column to use as latitude. Default = "decimalLatitude".
Character. The name of the column to use as longitude. Default = "decimalLongitude".
Numeric. The number of decimal places to flag in decimal degrees. For example, argument value of 2 would flag occurrences with nothing in the hundredths place (0.0x).
Logical. If TRUE, the functino will run a little quieter. Default = FALSE.
Returns the input data frame with a new column, .rou, where FALSE indicates occurrences that failed the test.
beesRaw_out <- jbd_coordinates_precision(
data = BeeBDC::beesRaw,
lon = "decimalLongitude",
lat = "decimalLatitude",
# number of decimals to be tested
ndec = 2
)
#> jbd_coordinates_precision:
#> Flagged 30 records
#> The '.rou' column was added to the database.
table(beesRaw_out$.rou, useNA = "always")
#>
#> FALSE TRUE <NA>
#> 30 70 0