plot_axes: Plot a pair of principal coordinates

Description Usage Arguments Details Examples

View source: R/posterior_analyses.R

Description

Plot a pair of principal coordinates

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_axes(
  coordinates = NULL,
  centroids,
  tax_level = "ASV",
  axis1 = 1,
  axis2 = 2,
  annotation = "host",
  MAP = FALSE,
  show_plot = FALSE
)

Arguments

coordinates

data.frame of coordinates from posterior embedding

centroids

data.frame of centroids from posterior embedding

tax_level

taxonomic level at which to agglomerate data

axis1

PCoA coordinate to display on x-axis

axis2

PCoA coordinate to display on y-axis

annotation

label to assign (e.g. individual)

MAP

use MAP estimate model output instead of full posterior output

show_plot

show() plot in addition to rendering it to a file

Details

Coordinates parameter is only necessary where we're plotting full host posteriors (i.e. where annotation="host").

Examples

1
2
3
4
5
6
tax_level <- "genus"
annotation <- "group"
MAP <- FALSE
centroids <- readRDS(file.path("output","plots",tax_level,"Sigma_ordination_centroids.rds"))
labelled_centroids <- get_other_labels(centroids=centroids, tax_level=tax_level, annotation=annotation, MAP=MAP)
plot_axes(coordinates=labelled_centroids, tax_level=tax_level, axis1=1, axis2=2, annotation=annotation, MAP=MAP)

kimberlyroche/ROL documentation built on Dec. 10, 2020, 2:18 a.m.