addOrthProjection {RCM} | R Documentation

## This function adds orthogonal projections to a given plot

### Description

This function adds orthogonal projections to a given plot

### Usage

    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

    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))

[Package RCM version 1.3.0 Index]