check_daisie_data: Check if a 'daisie_data' (i.e. a 'DAISIE' 'datalist') is...

View source: R/check_daisie_data.R

check_daisie_dataR Documentation

Check if a daisie_data (i.e. a DAISIE datalist) is valid. Will stop if not.

Description

Check if a daisie_data (i.e. a DAISIE datalist) is valid. Will stop if not.

Usage

check_daisie_data(daisie_data)

Arguments

daisie_data

a DAISIE datalist, as can be checked by check_daisie_data. To quote the DAISE doc:

A datalist is an object containing information on colonisation and branching times. This object can be generated using DAISIE_dataprep, which converts a user-specified data table into a datalist, but the object can of course also be entered directly.

A datalist is a list with the following elements:

The first element of the list has two or three components:

  • $island_age - the island age

Then, depending on whether a distinction between types is made, we have:

  • $not_present - the number of mainland lineages that are not present on the island

or:

  • $not_present_type1 - the number of mainland lineages of type 1 that are not present on the island

  • $not_present_type2 - the number of mainland lineages of type 2 that are not present on the island

The remaining elements of the datalist each contains information on a single colonist lineage on the island and has 5 components:

  • $colonist_name - the name of the species or clade that colonized the island

  • $branching_times - island age followed by stem age of the population/species in the case of Non-endemic, Non-endemic_MaxAge species and Endemic species with no close relatives on the island. For endemic clades with more than one species on the island (cladogenetic clades/ radiations) these should be island age followed by the branching times of the island clade including the stem age of the clade

  • $stac - the status of the colonist, see stac_to_str for values and descriptions

  • $missing_species - number of island species that were not sampled for particular clade (only applicable for endemic clades)

  • $type1or2 - whether the colonist belongs to type 1 or type 2

Value

nothing

Note

this function would better fit in the DAISIE package

Author(s)

Richèl J.C. Bilderbeek

Examples


daisie_mainland_data <- sim_island_with_mainland(
  total_time = 1,
  m = 100,
  island_pars = c(1, 1, 50, 0.1, 1),
  mainland_ex = 0.5,
  mainland_sample_prob = 1,
  mainland_sample_type = "complete",
  replicates = 1,
  verbose = FALSE
)

ideal_multi_daisie_data <- daisie_mainland_data$ideal_multi_daisie_data

daisie_data <- ideal_multi_daisie_data[[1]]
check_daisie_data(daisie_data)

joshwlambert/DAISIEmainland documentation built on July 14, 2024, 5:40 p.m.