plot_NMDS: NMDS plot unsing grindr layers

View source: R/gr-NMDS.R

plot_NMDSR Documentation

NMDS plot unsing grindr layers

Description

Quickly vizualise MDS and NMDS objects and build customs plots using the layers. See examples.

Usage

plot_NMDS(
  x,
  f = NULL,
  axes = c(1, 2),
  points = TRUE,
  points_transp = 1/4,
  chull = TRUE,
  chullfilled = FALSE,
  labelgroups = FALSE,
  legend = TRUE,
  title = "",
  box = TRUE,
  axesnames = TRUE,
  palette = pal_qual
)

plot_MDS(
  x,
  f = NULL,
  axes = c(1, 2),
  points = TRUE,
  points_transp = 1/4,
  chull = TRUE,
  chullfilled = FALSE,
  labelgroups = FALSE,
  legend = TRUE,
  title = "",
  box = TRUE,
  axesnames = TRUE,
  palette = pal_qual
)

Arguments

x

the result of MDS or NMDS

f

factor specification to feed fac_dispatcher

axes

numeric of length two to select PCs to use (c(1, 2) by default)

points

logical whether to draw this with layer_points

points_transp

numeric to feed layer_points (default:0.25)

chull

logical whether to draw this with layer_chull

chullfilled

logical whether to draw this with layer_chullfilled

labelgroups

logical whether to draw this with layer_labelgroups

legend

logical whether to draw this with layer_legend

title

character if specified, fee layer_title (default to "")

box

logical whether to draw this using layer_box

axesnames

logical whether to draw this using layer_axesnames

palette

color palette to use col_summer by default

Value

a plot

See Also

Other grindr: drawers, layers_morphospace, layers, mosaic_engine(), papers, pile(), plot_LDA(), plot_PCA()

Examples

### First prepare an NMDS object
x <- bot %>% efourier %>% NMDS

plot_NMDS(x)
plot_NMDS(x, ~type) %>% layer_stars() %>% layer_labelpoints()

### Same on MDS object
x <- bot %>% efourier %>% MDS

plot_MDS(x)
plot_MDS(x, ~type) %>% layer_stars() %>% layer_labelpoints()

MomX/Momocs documentation built on Nov. 18, 2023, 10:53 p.m.