correlogram.formula: Phylogenetic Correlogram

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/MoranI.R

Description

This function computes a correlogram from taxonomic levels.

Usage

1
  correlogram.formula(formula, data = NULL, use = "all.obs")

Arguments

formula

a formula of the type y1+..+yn ~ g1/../gn, where the y's are the data to analyse and the g's are the taxonomic levels.

data

a data frame containing the variables specified in the formula. If NULL, the variables are sought in the user's workspace.

use

a character string specifying how to handle missing values (i.e., NA). This must be one of "all.obs", "complete.obs", or "pairwise.complete.obs", or any unambiguous abbrevation of these. In the first case, the presence of missing values produces an error. In the second case, all rows with missing values will be removed before computation. In the last case, missing values are removed on a case-by-case basis.

Details

See the vignette in R: vignette("MoranI").

Value

An object of class correlogram which is a data frame with three columns:

obs

the computed Moran's I

p.values

the corresponding P-values

labels

the names of each level

or an object of class correlogramList containing a list of objects of class correlogram if several variables are given as response in formula.

Author(s)

Julien Dutheil [email protected] and Emmanuel Paradis

See Also

plot.correlogram, Moran.I

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(carnivora)
### Using the formula interface:
co <- correlogram.formula(SW ~ Order/SuperFamily/Family/Genus,
      data=carnivora)
co
plot(co)
### Several correlograms on the same plot:
cos <- correlogram.formula(SW + FW ~ Order/SuperFamily/Family/Genus,
      data=carnivora)
cos
plot(cos)

Example output

           obs     p.values      labels
1  0.432479537 8.806040e-05       Genus
2  0.572366226 0.000000e+00      Family
3 -0.119934300 2.135604e-10 SuperFamily
4 -0.004402383 6.776239e-01       Order
$SW
           obs     p.values      labels
1  0.432479537 8.806040e-05       Genus
2  0.572366226 0.000000e+00      Family
3 -0.119934300 2.135604e-10 SuperFamily
4 -0.004402383 6.776239e-01       Order

$FW
           obs     p.values      labels
1  0.416061385 1.438192e-04       Genus
2  0.553969731 0.000000e+00      Family
3 -0.115995018 6.972364e-10 SuperFamily
4 -0.004643436 6.915611e-01       Order

attr(,"class")
[1] "correlogramList"

ape documentation built on Sept. 24, 2018, 9:03 a.m.