map_coord_clean: Map geographic coordinates of observational data that have...

Description Usage Arguments Value Examples

View source: R/map_coord_clean.R

Description

Generates a ggplot object and user can opt to save maps of maps of all occurrence records and the occurrence records that were flagged by a coordinate cleaning procedure as potentially problematic.

Usage

1
2
3
4
5
6
7
8
9
map_coord_clean(
  df,
  lon,
  lat,
  species,
  flagged,
  imagedir = "NotNeeded",
  saveimage = FALSE
)

Arguments

df

a data.frame containing the geographical coordinates (e.g., latitude and longitude), species names, and if the particular coordinates were flagged as potentially problematic.

lon

a character string containing the column name with the longitudinal coordinates. Default = "decimalLongitude".

lat

a character string containing the column name with the latitudinal coordinates. Default = "decimalLatitude".

species

a character string that is the same length as rows in the data.frame with the species identity for each record. If missing, outlier test is skipped.

flagged

a character string containing the column name with a logical value for each coordinate in the dataframe. TRUE is interpreted as a potentially problematic coordinate.

imagedir

Path of a directory to save figure of mapped occurrence records to. Default = "NotNeeded"

saveimage

logical. If TRUE, figure of maps showing all occurrence records and flagged occurrence records are saved to imagedir. Default = FALSE

Value

A ggplot object that shows a map of all occurrence records and the records that are potentially problematic.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# generate test dataframe
test_data <- data.frame(species = "Test species",
decimallongitude = runif(100, min = 42, max = 51),
decimallatitude = runif(100, min = -26, max = -11))

# flag potentially problematic coordinates using CoordinateCleaner Function
cc <- CoordinateCleaner::clean_coordinates(x = test_data)

# generate map of flagged occurrence records

map_coord_clean(df = cc, lon = "decimallongitude",
lat = "decimallatitude", species = "Test species", flagged = ".summary")

mbelitz/autoSDM documentation built on Dec. 21, 2021, 3:55 p.m.