ggspaghetti: Spaghetti Plot of 'mc' or 'mcnode' Object

View source: R/ggspaghetti.R

ggspaghettiR Documentation

Spaghetti Plot of 'mc' or 'mcnode' Object

Description

Use ggplot to draw spaghetti plots for the [mc] or [mcnode] objects.

Usage

ggspaghetti(x, ...)

## S3 method for class 'mc'
ggspaghetti(
  x,
  griddim = NULL,
  xlab = names(x),
  ylab = "F(n)",
  main = "",
  maxlines = 100,
  ...
)

## S3 method for class 'mcnode'
ggspaghetti(
  x,
  griddim = NULL,
  xlab = names(x),
  ylab = "F(n)",
  main = "",
  which = NULL,
  maxlines = 100,
  ...
)

Arguments

x

an 'mc' or an 'mcnode' object

...

further arguments to be passed to [ggplot2::stat_ecdf()]

griddim

a vector of two integers, indicating the size of the grid of the graph. If 'NULL', the grid is calculated to produce a "nice" graph.

xlab

vector of labels for the x-axis. If 'NULL', use the name of the node.

ylab

vector of labels for the y-axis.

main

vector of main titles of the graph

maxlines

the maximum number of ecdf to draw.

which

An argument used for an 'mcnode' with multivariates. Can specify which variate plot to display. When variates are more than one, the output will be saved in a plot list by default or use the number of which variate to display.

Author(s)

Yu Chen and Regis Pouillot

Examples

data(ec)
EC2 <- evalmcmod(ec[[2]])
# When the input is an mc object
ggspaghetti(EC2)
# When the input is an mcnode object
data(total)
# mcnode with one variate
ggspaghetti(xV)
# This mcnode has two variates: the plots are returned in a list
gplots <- ggspaghetti(xVUM)
gplots[[1]]
# directly show the plot of the first variate
ggspaghetti(xVUM, which = 1)


mc2d documentation built on Oct. 23, 2026, 1:06 a.m.