cc_coun.RdRemoves or flags mismatches between geographic coordinates and additional country information (usually this information is reliably reported with specimens). Such a mismatch can occur for example, if latitude and longitude are switched.
cc_coun(x, lon = "decimallongitude", lat = "decimallatitude", iso3 = "countrycode", value = "clean", ref = NULL, verbose = TRUE)
| x | data.frame. Containing geographical coordinates and species names. |
|---|---|
| lon | character string. The column with the longitude coordinates. Default = “decimallongitude”. |
| lat | character string. The column with the latitude coordinates. Default = “decimallatitude”. |
| iso3 | a character string. The column with the country assignment of each record in three letter ISO code. Default = “countrycode”. |
| value | character string. Defining the output value. See value. |
| ref | a SpatialPolygonsDataFrame. Providing the geographic gazetteer.
Can be any SpatialPolygonsDataFrame, but the structure must be identical to
|
| verbose | logical. If TRUE reports the name of the test and the number of records flagged. |
Depending on the ‘value’ argument, either a data.frame
containing the records considered correct by the test (“clean”) or a
logical vector (“flagged”), with TRUE = test passed and FALSE = test failed/potentially
problematic . Default = “clean”.
With the default reference, records are flagged if they fall outside the terrestrial territory of countries, hence records in territorial waters might be flagged. See https://ropensci.github.io/CoordinateCleaner/ for more details and tutorials.
Other Coordinates: cc_cap,
cc_cen, cc_dupl,
cc_equ, cc_gbif,
cc_inst, cc_iucn,
cc_outl, cc_sea,
cc_urb, cc_val,
cc_zero
# NOT RUN { x <- data.frame(species = letters[1:10], decimallongitude = runif(100, -20, 30), decimallatitude = runif(100, 35,60), countrycode = "RUS") cc_coun(x, value = "flagged")#non-terrestrial records are flagged as wrong. # }