Learn R Programming

rbiom (version 2.1.2)

distmat_ord_table: Run ordinations on a distance matrix.

Description

Run ordinations on a distance matrix.

Usage

distmat_ord_table(dm, ord = "PCoA", k = 2L, ...)

Value

A data.frame with columns .sample, .ord, .x, .y, and (optionally) .z.

Arguments

dm

A dist-class distance matrix, as returned from bdiv_distmat() or stats::dist(). Required.

ord

Method for reducing dimensionality. Options are:

"PCoA" -

Principal coordinate analysis; ape::pcoa().

"UMAP" -

Uniform manifold approximation and projection; uwot::umap().

"NMDS" -

Nonmetric multidimensional scaling; vegan::metaMDS().

"tSNE" -

t-distributed stochastic neighbor embedding; tsne::tsne().

Multiple/abbreviated values allowed. Default: "PCoA"

k

Number of ordination dimensions to return. Either 2L or 3L. Default: 2L

...

Additional arguments for ord.

See Also

Other ordination: bdiv_ord_plot(), bdiv_ord_table()

Examples

Run this code
    library(rbiom) 
    
    dm  <- bdiv_distmat(hmp50, "bray")
    ord <- distmat_ord_table(dm, "PCoA")
    head(ord)
    

Run the code above in your browser using DataLab