plotgg.PCO: Plotting a PCoA

View source: R/plotgg.r

plotgg.PCOR Documentation

Plotting a PCoA

Description

Function for plotting results of PCO.

Usage

## S3 method for class 'PCO'
plotgg(
  x,
  components = c("PCo1", "PCo2"),
  shape = NULL,
  col = NULL,
  fill = NULL,
  point_size = 2
)

Arguments

x

A PCO object.

components

Vector of length 2 indicating which components to plot.

shape

String indicating which variable to use as aestetics mapping for shape. Must correspond to a column header in the Map attribute of the PCO object.

col

String indicating which variable to use as aestetics mapping for color. Must correspond to a column header in the Map attribute of the PCO object.

fill

String indicating which variable to use as aestetics mapping for fill. Must correspond to a column header in the Map attribute of the PCO object.

point_size

point_size

size for the points in the plot

Value

A ggplot2 object of the PCoA plot.

Author(s)

Sur from Dangl Lab.

See Also

PCO

Examples

data(Rhizo)
data(Rhizo.map)
Dat <- create_dataset(Rhizo,Rhizo.map)

# distfun <- function(x) vegan::vegdist(x,method="bray") #requires vegan package
distfun <- dist

Dat.pco <- PCO(Dat,dim=2,distfun=distfun)
plotgg(Dat.pco)
plotgg(Dat.pco,shape="fraction",point_size=3)
plotgg(Dat.pco,shape="fraction",col="accession",point_size=4)

surh/AMOR documentation built on Feb. 21, 2023, 6:31 a.m.