ph_rao {phylocomr}R Documentation

rao - Rao's quadratic entropy

Description

A measure of within- and among-community diversity taking species dissimilarity (phylogenetic dissimilarity) into account

Usage

ph_rao(sample, phylo)

Arguments

sample

(data.frame/character) sample data.frame or path to a sample file

phylo

(character/phylo) One of: phylogeny as a newick string (will be written to a temp file) - OR path to file with a newick string - OR a an ape phylo object. required.

Details

See phylocomr-inputs for expected input formats

Value

A list of 6 data.frame's: Diversity components:

Within-community diversity:

The remaining 4 tables compare each community pairwise:

Taxon name case

In the sample table, if you're passing in a file, the names in the third column must be all lowercase; if not, we'll lowercase them for you. If you pass in a data.frame, we'll lowercase them for your. All phylo tip/node labels are also lowercased to avoid any casing problems

See Also

Other phylogenetic-diversity: ph_pd()

Examples

sfile <- system.file("examples/sample_comstruct", package = "phylocomr")
pfile <- system.file("examples/phylo_comstruct", package = "phylocomr")

# sample from data.frame, phylogeny from a string
sampledf <- read.table(sfile, header = FALSE,
  stringsAsFactors = FALSE)
phylo_str <- readLines(pfile)

ph_rao(sample = sampledf, phylo = phylo_str)

# both from files
sample_str <- paste0(readLines(sfile), collapse = "\n")
sfile2 <- tempfile()
cat(sample_str, file = sfile2, sep = '\n')
pfile2 <- tempfile()
phylo_str <- readLines(pfile)
cat(phylo_str, file = pfile2, sep = '\n')

ph_rao(sample = sfile2, phylo = pfile2)

[Package phylocomr version 0.3.4 Index]