clean_dup: Function to clean duplicated longitude and latitude data

View source: R/clean_dup.R

clean_dupR Documentation

Function to clean duplicated longitude and latitude data

Description

Clean duplicated longitude and latitude data using threshold distance which is a distance (in grades) between points to be considered duplicates.

Usage

clean_dup(data, longitude, latitude, threshold = 0)

Arguments

data

A data.frame with longitude and latitude data

longitude

A character vector of the column name of longitude.

latitude

A character vector of the column name of latitude.

threshold

A numeric value representing the Euclidean distance between coordinates to be considered a duplicate.

Value

Returns a data.frame with coordinate data from species

Examples

# Species genus
genus <- "ambystoma"
# Species name
species <- "tigrinum"
## Not run: 
# GBIF search
ambystoma_tigrinum <- searh_gbif_data(genus,species,
                                       occlim=100,
                                       writeFile=FALSE)
ambystoma_tigrinum_clean <- clean_dup(ambystoma_tigrinum,
                                    longitude = "longitude",
                                    latitude = "latitude",
                                    threshold=0.1666)
# Check the dimensions of  data
dim(ambystoma_tigrinum)
dim(ambystoma_tigrinum_clean)

## End(Not run)


luismurao/ntbox documentation built on May 9, 2024, 8:24 p.m.