mp_plot_ord | R Documentation |
Plotting the result of PCA, PCoA, CCA, RDA, NDMS or DCA
mp_plot_ord(
.data,
.ord,
.dim = c(1, 2),
.group = NULL,
.starshape = 15,
.size = 2,
.alpha = 1,
.color = "black",
starstroke = 0.5,
show.side = TRUE,
show.adonis = FALSE,
ellipse = FALSE,
show.sample = FALSE,
show.envfit = FALSE,
p.adjust = NULL,
filter.envfit = FALSE,
...
)
## S4 method for signature 'MPSE'
mp_plot_ord(
.data,
.ord,
.dim = c(1, 2),
.group = NULL,
.starshape = 15,
.size = 2,
.alpha = 1,
.color = "black",
starstroke = 0.5,
show.side = TRUE,
show.adonis = FALSE,
ellipse = FALSE,
show.sample = FALSE,
show.envfit = FALSE,
p.adjust = NULL,
filter.envfit = FALSE,
...
)
## S4 method for signature 'tbl_mpse'
mp_plot_ord(
.data,
.ord,
.dim = c(1, 2),
.group = NULL,
.starshape = 15,
.size = 2,
.alpha = 1,
.color = "black",
starstroke = 0.5,
show.side = TRUE,
show.adonis = FALSE,
ellipse = FALSE,
show.sample = FALSE,
show.envfit = FALSE,
p.adjust = NULL,
filter.envfit = FALSE,
...
)
## S4 method for signature 'grouped_df_mpse'
mp_plot_ord(
.data,
.ord,
.dim = c(1, 2),
.group = NULL,
.starshape = 15,
.size = 2,
.alpha = 1,
.color = "black",
starstroke = 0.5,
show.side = TRUE,
show.adonis = FALSE,
ellipse = FALSE,
show.sample = FALSE,
show.envfit = FALSE,
p.adjust = NULL,
filter.envfit = FALSE,
...
)
.data |
MPSE or tbl_mpse object, it is required. |
.ord |
a name of ordination (required), options are PCA, PCoA, DCA, NMDS, RDA, CCA, but the corresponding calculation methods (mp_cal_pca, mp_cal_pcoa, ...) should be done with action="add" before it. |
.dim |
integer which dimensions will be displayed, it should be a vector (length=2) default is c(1, 2). if the length is one the default will also be displayed. |
.group |
the column name of variable to be mapped to the color of points (fill character
of |
.starshape |
the column name of variable to be mapped to the shapes of points (starshape
character of |
.size |
the column name of variable to be mapped to the size of points (size character of
|
.alpha |
the column name of variable to be mapped to the transparency of points (alpha
character of |
.color |
the column name of variable to be mapped to the color of line of points (color
character of |
starstroke |
numeric the width of edge of points, default is 0.5. |
show.side |
logical whether display the side boxplot with the specified |
show.adonis |
logical whether display the result of |
ellipse |
logical, whether to plot ellipses, default is FALSE. (.group or .color variables according to the 'geom', the default geom is path, so .color can be mapped to the corresponding variable). |
show.sample |
logical, whether display the sample names of points, default is FALSE. |
show.envfit |
logical, whether display the result after run [mp_envfit()], default is FALSE. |
p.adjust |
a character method of p.adjust |
filter.envfit |
logical or numeric, whether to remove the no significant environment factor after
run [mp_envfit()], default is FALSE, meaning do not remove. If it is numeric, meaning the keep p.value
or the adjust p with |
... |
additional parameters, see also the |
[mp_cal_pca()], [mp_cal_pcoa], [mp_cal_nmds], [mp_cal_rda], [mp_cal_cca], [mp_envfit()] and [mp_extract_internal_attr()]
## Not run:
library(vegan)
data(varespec, varechem)
mpse <- MPSE(assays=list(Abundance=t(varespec)), colData=varechem)
envformula <- paste("~", paste(colnames(varechem), collapse="+")) %>% as.formula
mpse %<>%
mp_cal_cca(.abundance=Abundance, .formula=envformula, action="add") %>%
mp_envfit(.ord=CCA, .env=colnames(varechem), permutations=9999, action="add")
mpse
p1 <- mpse %>% mp_plot_ord(.ord=CCA, .group=Al, .size=Mn)
p1
p2 <- mpse %>% mp_plot_ord(.ord=CCA, .group=Al, .size=Mn, show.sample=TRUE)
p2
p3 <- mpse %>% mp_plot_ord(.ord=CCA, .group="blue", .size=Mn, .alpha=0.8, show.sample=TRUE)
p3
p4 <- mpse %>% mp_plot_ord(.ord=CCA, .group=Al, .size=Mn, show.sample=TRUE, show.envfit=TRUE)
p4
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.