cc_inst.RdRemoves or flags records assigned to the location of zoos, botanical gardens, herbaria, universities and museums, based on a global database of ~10,000 such biodiversity institutions. Coordinates from these locations can be related to data-entry errors, false automated geo-reference or individuals in captivity/horticulture.
cc_inst(x, lon = "decimallongitude", lat = "decimallatitude", species = "species", buffer = 100, geod = TRUE, ref = NULL, verify = FALSE, verify_mltpl = 10, value = "clean", 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”. |
| species | character string. The column with the species identity. Only required if verify = TRUE. |
| buffer | numerical. The buffer around each institution, where records should be flagged as problematic, in decimal degrees. Default = 100m. |
| geod | logical. If TRUE the radius around each capital is calculated based on a sphere, buffer is in meters and independent of latitude. If FALSE the radius is calculated assuming planar coordinates and varies slightly with latitude, in this case buffer is in degrees. Default = TRUE. See https://seethedatablog.wordpress.com/ for detail and credits. |
| ref | SpatialPointsDataFrame. Providing the geographic gazetteer. Can
be any SpatialPointsDataFrame, but the structure must be identical to
|
| verify | logical. If TRUE, records close to institutions are only flagged, if there are no other records of the same species in the greater vicinity (a radius of buffer * verify_mltpl). |
| verify_mltpl | numerical. indicates the factor by which the radius for verify exceeds the radius of the initial test. Default = 10, which might be suitable if geod is TRUE, but might be too large otherwise. |
| value | character string. Defining the output value. See value. |
| 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”.
Note: the buffer radius is in degrees, thus will differ slightly between different latitudes.
See https://ropensci.github.io/CoordinateCleaner for more details and tutorials.
Other Coordinates: cc_cap,
cc_cen, cc_coun,
cc_dupl, cc_equ,
cc_gbif, cc_iucn,
cc_outl, cc_sea,
cc_urb, cc_val,
cc_zero
x <- data.frame(species = letters[1:10], decimallongitude = runif(100, -180, 180), decimallatitude = runif(100, -90,90)) #large buffer for demonstration, using geod = FALSE for shorter runtime cc_inst(x, value = "flagged", buffer = 10, geod = FALSE)#>#> Warning: Spatial object is not projected; GEOS expects planar coordinates#>#> 1 2 3 4 5 6 7 8 9 10 11 12 13 #> TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE #> 14 15 16 17 18 19 20 21 22 23 24 25 26 #> TRUE FALSE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE #> 27 28 29 30 31 32 33 34 35 36 37 38 39 #> FALSE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE #> 40 41 42 43 44 45 46 47 48 49 50 51 52 #> FALSE TRUE TRUE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE #> 53 54 55 56 57 58 59 60 61 62 63 64 65 #> TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE FALSE TRUE FALSE #> 66 67 68 69 70 71 72 73 74 75 76 77 78 #> TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE TRUE #> 79 80 81 82 83 84 85 86 87 88 89 90 91 #> TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE #> 92 93 94 95 96 97 98 99 100 #> TRUE TRUE TRUE TRUE TRUE FALSE TRUE TRUE TRUE# NOT RUN { #' cc_inst(x, value = "flagged", buffer = 50000) #geod = T # }