addOrthProjection: This function adds orthogonal projections to a given plot

Description Usage Arguments Value See Also Examples

View source: R/F_addOrthProjection.R

Description

This function adds orthogonal projections to a given plot

Usage

1
2
3
4
5
6
7
8
9
addOrthProjection(
  RCMplot,
  sample = NULL,
  species = NULL,
  variable = NULL,
  Dims = c(1, 2),
  addLabel = FALSE,
  labPos = NULL
)

Arguments

RCMplot

the RCMplot object

sample, species, variable

names or approximate coordinates of sample, species or variable

Dims

The dimensions of the solutions that have been plotted

addLabel

a boolean, should the r-s-psi label be added?

labPos

the position of the label. Will be calculated if not provided

Value

a modified ggplot object that contains the geom_segment object that draws the projection

See Also

plot.RCM

Examples

1
2
3
4
5
6
7
data(Zeller)
require(phyloseq)
tmpPhy = prune_taxa(taxa_names(Zeller)[seq_len(100)],
prune_samples(sample_names(Zeller)[seq_len(50)], Zeller))
zellerRCM = RCM(tmpPhy, k = 2, round = TRUE)
zellerPlot = plot(zellerRCM, returnCoords = TRUE)
addOrthProjection(zellerPlot, species = c(-0.35,1.1), sample = c(1,1.2))

RCM documentation built on Nov. 8, 2020, 5:22 p.m.

Related to addOrthProjection in RCM...