Plot location where trait data was collected from
Arguments
- database
traits.build database OR traits table from a traits.build database. Note location details must be joined. See join_location_coordinates and examples
- feature
grouping/classification categories e.g trait_name, collection_type for <= v3.0.2, basis of record for >3.0.2
- ...
arguments passed to ggpointdensity::geom_pointdensity()
- basemap
NULL(the default) draws every location without a map. Or a data frame of map cells to draw the locations over, with numeric columnsx(longitude) andy(latitude), one row per land cell, as used byggplot2::geom_raster(); other columns, and rows missingxory, are ignored. Locations beyond the map (plus half a degree) are left out, with a message saying how many records that affects; if no location lies on the map, it stops with an error. Theaustraitspackage passes a map of Australia here.
Examples
# All traits from a given study
data <- austraits_lite %>%
extract_dataset(dataset_id = "Falster_2003") %>%
join_location_coordinates()
data %>% plot_locations("trait_name")
# Single trait
data <- austraits_lite %>%
extract_trait(trait_names = "plant_height") %>%
join_location_coordinates()
data$traits %>% plot_locations("trait_name")
# Over a map: pass `basemap`, a data frame of land cells with columns x and
# y, such as `raster::as.data.frame(r, xy = TRUE, na.rm = TRUE)` of a land
# raster `r`. `austraits::plot_locations()` draws a map of Australia.