View source: R/process_presence_absence.R
clean_coordinates | R Documentation |
This function cleans coordinates of presence/absence data by removing NA coordinates, rounding coordinates if specified, removing duplicated points, and removing points outside specified spatial polygon boundaries.
clean_coordinates(
df,
study_area,
overlapping = FALSE,
decimal_digits = NULL,
coords = c("decimalLongitude", "decimalLatitude"),
by_timestamp = TRUE,
seed = NULL
)
df |
A dataframe object with rows representing points. Coordinates are in WGS84 (EPSG:4326) coordinate system. |
study_area |
A spatial polygon in WGS84 (EPSG:4326) representing the boundaries within which coordinates should be kept. |
overlapping |
Logical indicating whether points overlapping the polygon should be removed (TRUE) or kept (FALSE). |
decimal_digits |
An integer specifying the number of decimal places to which coordinates should be rounded. |
coords |
Character vector specifying the column names for longitude and latitude. |
by_timestamp |
If TRUE, clean coordinates taking into account different time periods defined in the column 'timestamp'. |
seed |
Optional; an integer seed for reproducibility of results. |
This function takes a data frame containing presence/absence data with longitude and latitude coordinates, a spatial polygon representing boundaries within which to keep points, and parameters for rounding coordinates and handling duplicated points. It returns a cleaned data frame with valid coordinates within the specified boundaries.
A cleaned data frame containing presence/absence data with valid coordinates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.