clean_points: Clean occurrence records

Description Usage Arguments Value Examples

View source: R/clean_points.R

Description

clean_points Eliminates species occurrence records that are too close to each other or at undesired locations.

Usage

1
2
clean_points(coord, merge_dist = 2, reference_layer,
  layer_filter = NULL, dist_unit = "km")

Arguments

coord

data.frame. Data frame containing longitudes (Lon) and latitudes (Lat) of occurrence records of a species.

merge_dist

numeric. Maximum distance between points to be merged.

reference_layer

Raster* object. Any raster for the area containing the occurrence records.

layer_filter

Values for locations at reference raster which occurrence records should be eliminated.

dist_unit

character. Unit for the merging distance. Either 'km' for kilometers or 'degrees' for decimal degrees.

Value

Data frame with remaining longitudes and latitudes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
FulanusEcoRasters_present <-
  get_rasters(
    raster_source = "/Users/gabriel/Documents/Mapinguari/global_grids_10_minutes",
    ext = FulanusDistribution,
    margin = 5,
    non_fixed_var = c('prec', 'tmin', 'tmax'),
    fixed_var = 'alt',
    years = c("present"),
    reorder = TRUE)

alt <- FulanusEcoRasters_present$present$alt

clean_points(coord = FulanusDistribution,
  merge_dist = 2,
  reference_layer = alt > 500 & alt < 1000,
  layer_filter = 0)

gabrielhoc/MapinguariLegacy documentation built on May 8, 2019, 9:54 p.m.