R/cluster_functions.R
summary_tables.Rd
summary_tables
joins individuals to site location metadata to create
summary tables.
summary_tables(
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.
Three csv tables are written to the `results/finalised/` sub-directory as described in details above.
Takes the groups csv, from running majorities
and a
provided lookup table of metadata per sample and provides three summary
tables:
capture history
individual by date and site
site stats
The user is required to map required fields from the lookup table to the function parameters. At a minimum the lookup should contain the following:
sample ID
site ID
collection date
latitude (WGS84)
longitude (WGS84)
if (FALSE) {
summary_tables(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")
}