R/bdc_coordinates_empty.R
bdc_coordinates_empty.Rd
This function flags records missing latitude or longitude coordinates.
bdc_coordinates_empty(data, lat = "decimalLatitude", lon = "decimalLongitude")
A data.frame containing the column ".coordinates_empty". Compliant (TRUE) if 'lat' and 'lon' are not empty; otherwise "FALSE".
This test identifies records missing geographic coordinates (i.e., empty or not applicable NA longitude or latitude)
x <- data.frame(
decimalLatitude = c(19.9358, -13.016667, NA, ""),
decimalLongitude = c(-40.6003, -39.6, -20.5243, NA)
)
bdc_coordinates_empty(
data = x,
lat = "decimalLatitude",
lon = "decimalLongitude"
)
#>
#> bdc_coordinates_empty:
#> Flagged 2 records.
#> One column was added to the database.
#> decimalLatitude decimalLongitude .coordinates_empty
#> 1 19.9358 -40.6003 TRUE
#> 2 -13.016667 -39.6000 TRUE
#> 3 <NA> -20.5243 FALSE
#> 4 NA FALSE