addLink: Add a link on a compositional plot

Description Usage Arguments Value Examples

View source: R/addLink.R

Description

Add a link on a compositional plot

Usage

1
2
3
addLink(DIplot, links, Views, samples, variable = NULL, Dims = c(1, 2),
  addLabel = FALSE, labPos = NULL, projColour = "grey",
  latentSize = 0.25)

Arguments

DIplot

A list with ggplot object where the links are to be added, and data frames with coordinates (obtained by setting plot(..., returnCoords = TRUE))

links

A matrix containing either feature names (two column matrix) or approximate coordinates (four column matrix)

Views

Indices or names of the views for which the links should be added

samples

Sample names or approximate sample coordinates

variable

Name of variable in environmental gradient for which link should be plotted

Dims

vector of length 2 referring to the model dimensions

addLabel

A boolean, should arrow with label be plotted?

labPos

The position of the label, as a numeric vector of length 2

projColour

The colour of the projection, as character string

latentSize

Size of the line from the origin to the latent variable dot

Value

A ggplot object with the links added

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(Zhang)

#Unconstrained
microMetaboInt = combi(
list("microbiome" = zhangMicrobio, "metabolomics" = zhangMetabo),
distributions = c("quasi", "gaussian"), compositional = c(TRUE, FALSE),
logTransformGaussian = FALSE, verbose = TRUE)

load(system.file("extdata", "zhangFits.RData", package = "combi"))
Plot = plot(microMetaboInt, samDf = zhangMetavars, samCol = "ABX",
 returnCoords = TRUE)
addLink(Plot, links = cbind("OTU0565b3","OTUa14fb5"), Views = 1,
 samples = c(1,1))

combi documentation built on Nov. 8, 2020, 5:34 p.m.

Related to addLink in combi...