This function Identifies records whose coordinates can potentially be extracted from locality information.

bdc_coordinates_from_locality(
  data,
  lat = "decimalLatitude",
  lon = "decimalLongitude",
  locality = "locality",
  save_outputs = FALSE
)

Arguments

data

data.frame. Containing geographical coordinates and the column "locality'.

lat

character string. The column name with latitude in decimal degrees and WGS84. Default = "decimalLatitude".

lon

character string. The column with longitude in decimal degrees and WGS84. Default = "decimalLongitude".

locality

character string. The column name with locality information. Default = "locality".

save_outputs

logical. Should a table containing transposed coordinates saved for further inspection? Default = FALSE.

Value

A data.frame containing records missing or with invalid coordinates but with potentially useful locality information. When save_outputs = FALSE the data.frame is saved in Output/Check/01_coordinates_from_locality.csv

Details

According to DarwinCore terminology, locality refers to "the specific description of the place" where an organism was recorded.

Examples

x <- data.frame(
  lat = c(NA, NA, ""), 
  lon = c("", NA, NA), 
  locality = c("PARAGUAY: ALTO PARAGUAY: CO.; 64KM W PUERTO SASTRE", 
               "Parque Estadual da Serra de Caldas Novas, Goias, Brazil", 
               "Parque Nacional Iguazu"))

bdc_coordinates_from_locality(
data = x, 
lat = "lat", 
lon = "lon", 
locality = "locality", 
save_outputs = FALSE)
#> 
#> bdc_coordinates_from_locality 
#> Found 3 records missing or with invalid coordinates but with potentially useful information on locality.
#>    lat  lon                                                locality
#> 1 <NA>           PARAGUAY: ALTO PARAGUAY: CO.; 64KM W PUERTO SASTRE
#> 2 <NA> <NA> Parque Estadual da Serra de Caldas Novas, Goias, Brazil
#> 3      <NA>                                  Parque Nacional Iguazu
#>   .coordinates_empty .coordinates_outOfRange
#> 1              FALSE                    TRUE
#> 2              FALSE                    TRUE
#> 3              FALSE                    TRUE