Learn R Programming

Mapinguari (version 1.0.0)

clean_points: Clean occurrence records

Description

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

Usage

clean_points(coord, merge_dist, coord_col = c("Lon", "Lat"),
  filter_layer = NULL, na.rm = FALSE)

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, in meters.

coord_col

vector of strings or integers. If x has more than two columns, indicate the name or position of longitude and latitude columns

filter_layer

RasterLayer. Binary raster with 1 representing the regions where records should be kept and 0 the regions where they should be eliminated.

na.rm

logical. if TRUE, remove lines with NA in any coordinate.

Value

Data frame with remaining longitudes and latitudes.

Examples

Run this code
# NOT RUN {
 TtorquatusDistribution_clean <-
  clean_points(coord = TtorquatusDistribution,
               merge_dist = 20000,
               filter_layer = !is.na(df_alt))

# }

Run the code above in your browser using DataLab