Learn R Programming

DivInsight (version 0.1.0)

subset_by_coordinate_ref: Subset Occurrence Dataframe

Description

Subsets an occurrence dataframe by using a pair of reference coordinates and a radius distance.

Usage

subset_by_coordinate_ref(dataframe, coordinate_reference, distance_threshold)

Value

A dataframe with observations that occurred within the distance threshold from the coordinate reference

Arguments

dataframe

A dataframe from which occurrence data will be subset

coordinate_reference

A pair of longitude/latitude coordinates that will mark the centre of the occurrence data

distance_threshold

The distance from the coordinate reference that will be included in the subset

Examples

Run this code
# subset the occurrence data returning only data points 50km from the reference coordinates
Colombia_site_1 <-  subset_by_coordinate_ref(

 dataframe = Colombia,
 coordinate_reference = c(-74.083310, 7.488485),
 distance_threshold = 50000

)

head(Colombia_site_1)

Run the code above in your browser using DataLab