Learn R Programming

mc2d (version 0.2.0)

ggspaghetti: 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 mc ggspaghetti( x, griddim = NULL, xlab = names(x), ylab = "F(n)", main = "", maxlines = 100, ... )

# S3 method for 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

Yu Chen and Regis Pouillot

Examples

Run this code
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) 

Run the code above in your browser using DataLab