ade4_to_mvar: Convert an ade4 object into class mVarTable

Usage Arguments Value Examples

View source: R/conversion.R

Usage

1
ade4_to_mvar(ade4_object, tables_to_include)

Arguments

ade4_object

The output of a call to dudi.* from package ade4. This is generally a named list containing tables of multiple projections of interest. Calling class(ade4_object) should show ordination_method dudi.

tables_to_include

A character vector specifying which projections in the ade4 object to store in the mVarTable object. This vector can have arbitrary length, the only requirement is that calling ade4_object[tables_to_include[i]] should be a data frame.

Value

mvar_table An object of class mvarTable, storing the tables specified in tables_to_include and the eigenvalues from the ade4 decomposition. The annotation slots of each mVarLayer are the row names of the projected coordinates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 library("ade4")
 data(USArrests)
 arrests_pca <- dudi.pca(USArrests, scannf = FALSE, nf = 2)
 ade4_to_mvar(arrests_pca, c("li", "co"))
 arrests_pco <- dudi.pco(dist(USArrests), scannf = FALSE, nf = 2)
 ade4_to_mvar(arrests_pco, c("li", "co"))

 # Example taken from coinertia() in ade4 package
 data(doubs)
 dudi1 <- dudi.pca(doubs$env, scale = TRUE, scan = FALSE, nf = 3)
 dudi2 <- dudi.pca(doubs$fish, scale = FALSE, scan = FALSE, nf = 2)
 coin1 <- coinertia(dudi1,dudi2, scan = FALSE, nf = 2)
 ade4_to_mvar(coin1, tables_to_include = c("li", "co", "aX", "aY"))
 @export

krisrs1128/mvarVis documentation built on Oct. 13, 2019, 11:14 p.m.