check_pes_inputs: check_pes_inputs

View source: R/check_pes_inputs.r

check_pes_inputsR Documentation

check_pes_inputs

Description

Function used by phy_or_env_spec. checks abunds_mat, env, hosts, and hosts_phylo inputs to phy_or_env_spec to make sure there are no problems. This could include missing species in trees, incompatible dimensions, non-numeric inputs, etc. Returns an input type, which is just a string that can be "mat", "dist", "vec", "phy", or "error".

Usage

check_pes_inputs(abunds_mat, env, hosts, hosts_phylo, verbose = TRUE)

Arguments

abunds_mat

(required, see phy_or_env_spec)

env

(required, can be NULL, see phy_or_env_spec)

hosts

(required, can be NULL, see phy_or_env_spec)

hosts_phylo

(required, can be NULL, see phy_or_env_spec)

verbose

logical. Should status messages be displayed? (default: TRUE).

Value

string. either "mat", "dist", "vec", "phy", or "error".

Examples

# library(specificity)
# attach(endophyte)
# m <- occ_threshold(prop_abund(otutable), threshold=10)
# check_pes_inputs(m, env=metadata$Elevation, hosts=NULL, hosts_phylo=NULL)
# check_pes_inputs(m, env=NULL, hosts=metadata$PlantGenus, hosts_phylo=supertree)
# aspect_dis <- circularize2dist(metadata$Aspect, 360)
# check_pes_inputs(m, env=aspect_dis, hosts=NULL, hosts_phylo=NULL)


darcyj/specificity documentation built on Aug. 1, 2023, 8 a.m.