View source: R/gmDataFrameStack.R
| swarmPlot | R Documentation | 
Take a DataFrameStack() and apply a certain plotting function to each elements of the stack.
The result (typically a curve per each stack element), may then be plotted all together
swarmPlot(
  X,
  MARGIN = stackDim(X),
  PLOTFUN,
  ...,
  .plotargs = list(type = "l"),
  .parallelBackend = NA
)
X | 
 a   | 
MARGIN | 
 which dimension defines the stack? it has a good default! change only if you know what you do  | 
PLOTFUN | 
 the elemental calculating function; this must take as input one element of the stack and return as output the (x,y)-coordinates of the calculated curve for that element, in a list of two elements  | 
... | 
 further parameters to   | 
.plotargs | 
 either a logical, or else a list of graphical arguments to pass
to   | 
.parallelBackend | 
 NA or a parallelization strategy; currently unstable for certain operations and platforms.  | 
Invisibly, this function returns a list of the evaluation of PLOTFUN on
each element of the stack. If .plotargs other than FALSE, then the function calls
plot.swarmPlot() to produce a plot.
dm = list(point=1:100, var=LETTERS[1:2], rep=paste("r",1:5, sep=""))
ar = array(rnorm(1000), dim=c(100,2,5), dimnames = dm)
dfs = DataFrameStack(ar, stackDim="rep")
swarmPlot(dfs, PLOTFUN=function(x) density(x[,1]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.