ggordpoint: ordination plotter based on ggplot2.

Description Usage Arguments Value Author(s) Examples

View source: R/plot-ggordpoint.R

Description

ordination plotter based on ggplot2.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
ggordpoint(obj, ...)

## Default S3 method:
ggordpoint(
  obj,
  pc = c(1, 2),
  mapping = NULL,
  sampleda = NULL,
  factorNames = NULL,
  factorLevels = NULL,
  poinsize = 2,
  linesize = 0.3,
  arrowsize = 1.5,
  arrowlinecolour = "grey",
  ellipse = FALSE,
  showsample = FALSE,
  ellipse_pro = 0.9,
  ellipse_alpha = 0.2,
  biplot = FALSE,
  topn = 5,
  settheme = TRUE,
  speciesannot = FALSE,
  fontsize = 2.5,
  labelfactor = NULL,
  stroke = 0.1,
  fontface = "bold.italic",
  fontfamily = "sans",
  textlinesize = 0.02,
  ...
)

## S3 method for class 'pcasample'
ggordpoint(obj, ...)

Arguments

obj

prcomp class or pcasample class,

...

additional parameters, see geom_text_repel.

pc

integer vector, the component index.

mapping

set of aesthetic mapping of ggplot2, default is NULL when your want to set it by yourself, only alpha can be setted, and the first element of factorNames has been setted to map fill, and the second element of factorNames has been setted to map starshape, you can use scale_starshape_manual set the shapes.

sampleda

data.frame, nrow sample * ncol factors, default is NULL.

factorNames

vector, the names of factors contained sampleda.

factorLevels

list, the levels of the factors, default is NULL, if you want to order the levels of factor, you can set this.

poinsize

numeric, the size of point, default is 2.

linesize

numeric, the line size of segment, default is 0.3.

arrowsize

numeric, the size of arrow, default is 1.5.

arrowlinecolour

character, the color of segment, default is grey.

ellipse

logical, whether add confidence ellipse to ordinary plot, default is FALSE.

showsample

logical, whether show the labels of sample, default is FALSE.

ellipse_pro

numeric, confidence value for the ellipse, default is 0.9.

ellipse_alpha

numeric, the alpha of ellipse, default is 0.2.

biplot

logical, whether plot the species, default is FALSE.

topn

integer or vector, the number species have top important contribution, default is 5.

settheme

logical, whether set the theme for the plot, default is TRUE.

speciesannot

logical, whether plot the species, default is FALSE.

fontsize

numeric, the size of text, default is 2.5.

labelfactor

character, the factor want to be show in label, default is NULL.

stroke

numeric, the line size of points, default is 0.1.

fontface

character, the font face, default is "blod.italic".

fontfamily

character, the font family, default is "sans".

textlinesize

numeric, the segment size in geom_text_repel.

Value

point figures of PCA or PCoA.

Author(s)

Shuangbin Xu

Examples

1
2
3
4
5
6
7
8
9
#don't run in examples
#library(phyloseq)
#data(GlobalPatterns)
#subGlobal <- subset_samples(GlobalPatterns,
#         SampleType %in% c("Feces", "Mock", "Ocean", "Skin"))
#pcares <- get_pca(subGlobal, method="hellinger")
#pcaplot <- ggordpoint(pcares, biplot=TRUE,
#                    speciesannot=TRUE,
#                     factorNames=c("SampleType"), ellipse=TRUE)

MicrobiotaProcess documentation built on April 18, 2021, 6 p.m.