R/plot_functions.R
leaflet_map.Rd
leaflet_map
generates a self contained leaflet html map showing
locations of capture sites and individuals.
leaflet_map(
groups_csv,
metadata,
prefix,
sample,
site_ID,
field_date,
lat,
long
)
Character vector. Name of the numerical allele groups csv.
Character vector. Name of the lookup csv which should be located in the `source/` directory.
Character vector. Sample names in csv outputs often have a prefix such as "ID_" to avoid starting with a numeral and the lookup data often wont. Provide the prefix in the calculated data so that it can be matched to the lookup data.
Character vector. Name of the column in the lookup data that contains the sample IDs.
Character vector. Name of the column in the lookup data that contains the site/cave IDs.
Character vector. Name of the column in the lookup data that contains the sampling date.
Character vector. Name of the column in the lookup data that contains the latitude (WGS84) of the sample collection site.
Character vector. Name of the column in the lookup data that contains the longitude (WGS84) of the sample collection site.
It will write to html a leaflet map showing site and individuals locations.
When run it it creates an html leaflet map showing the locations of the field sites and where the individuals were sampled. The map is zoomable, layers can be turned on and off and there is a widget for calculating approximate distances and areas. Please note that the accuracy of the measurements is calculated using geodetic coordinates and is unlikely to be as accurate as measurements calculated using projected coordinates. The map will be saved to `results/finalised/`.
if (FALSE) {
leaflet_map(groups_csv = "hclust_numerical_mismatch_h4_withGroups.csv",
metadata = "lookup.csv", prefix = "ID_", sample = "sample", site_ID = "roost_name",
field_date = "collection_date", lat = "dec_lat", long = "dec_long")
}