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
)

Arguments

groups_csv

Character vector. Name of the numerical allele groups csv.

metadata

Character vector. Name of the lookup csv which should be located in the `source/` directory.

prefix

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.

sample

Character vector. Name of the column in the lookup data that contains the sample IDs.

site_ID

Character vector. Name of the column in the lookup data that contains the site/cave IDs.

field_date

Character vector. Name of the column in the lookup data that contains the sampling date.

lat

Character vector. Name of the column in the lookup data that contains the latitude (WGS84) of the sample collection site.

long

Character vector. Name of the column in the lookup data that contains the longitude (WGS84) of the sample collection site.

Value

Three csv tables are written to the `results/finalised/` sub-directory as described in details above.

Details

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)

Author

Bart Huntley, bart.huntley@dbca.wa.gov.au

For more details see https://dbca-wa.github.io/ScatMatch/index.html the ScatMatch website

Examples

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")
}