View source: R/bdc_coordinates_precision.R
bdc_coordinates_precision | R Documentation |
This function flags records with a coordinate precision below a specified number of decimal places. Coordinates with one, two, or three decimal places present a precision of~11.1 km, ~1.1 km, and ~111 m at the equator, respectively.
bdc_coordinates_precision(
data,
lat = "decimalLatitude",
lon = "decimalLongitude",
ndec = c(0, 1, 2)
)
data |
data.frame. A data.frame containing geographic coordinates. |
lat |
character string. The column with latitude in decimal degrees and WGS84. Default = "decimalLatitude". |
lon |
character string. The column with longitude in decimal degrees and WGS84. Default = "decimalLongitude". |
ndec |
numeric. The minimum number of decimal places that the coordinates should have to be considered valid. Default = 2. |
A data.frame with logical values indicating whether values are equal or higher than the specified minimum decimal number (ndec). Coordinates flagged as FALSE in .rou column are considered imprecise.
x <- data.frame(
lat = c(-21.34, 23.567, 16.798, -10.468),
lon = c(-55.38, -13.897, 30.8, 90.675)
)
bdc_coordinates_precision(
data = x,
lat = "lat",
lon = "lon",
ndec = 3
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.