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 mc object
ggspaghetti(EC2) 
# When the input is mcnode object
data(total)
# mcnode has one variate
ggspaghetti(xV) 
# This mcnode has two variates, will save two plots in a list
gplots <- ggplotmc(xVUM) #will save two plots in a list
# show the first variate plot of xVUM mcnode
gplots[[1]] 
# directly show the first variate plot of xVUM mcnode
ggspaghetti(xVUM, which = 1) 


mc2d documentation built on July 26, 2023, 6:07 p.m.