panelplot.anyKind: Creation of a Matrix of Many Plots for Exploratory Analyses

Description Usage Arguments Examples

Description

Creates one to a large number of exploratory plots, where the user has control over how the subplots (panels) are arranged on the plots, without needing to keep track of how many plots are created. The function can be used to display the plots on the screen, pausing between each plot, or to save the plots to either pdf of eps files. If the latter, the user also has the option to create a simple LaTeX fragment which can be included in LaTeX code to show all the plots created. The scatter plots by default show the correlation and sample size on the plot titles (the user can change this). By giving the relevant argument for lookup.vec, this function will call on lookup to display the longer names for the x- and y-axes. There are 2 primary situations in which one might want to call panelplot: (1) when we want to plot one or more outcome variables (ynames) versus one or more covariates (xnames); and (2) when we want to make all unique plots. The latter is similar to pairs(), but it doesn't include duplicate plots, the user has control over how many plots to place on a page, and the plots can contain the correlations and number of observations on the plot title.

Usage

1
2
3
4
5
6
7
panelplot.anyKind(tdat, ynames = colnames(tdat), xnames = colnames(tdat),
  tnrows = 2, tncols = 2, maxperpage = tnrows * tncols,
  new.page.x.var = FALSE, new.page.y.var = FALSE, plotmain = NULL,
  uniqueplots = FALSE, skipSameXY = FALSE, save.plots = FALSE,
  type.plots = "pdf", latex = FALSE, full.latex = FALSE,
  basename = NULL, lookup.vec = NULL, showr = TRUE, use.pch = 1,
  use.cex = 1, wait.between = FALSE, ...)

Arguments

tdat

dataframe with variables for y-axes,

ynames

names of variables to go on y-axis

xnames

names of variables to go on x-axis

tnrows

number of rows of plots

tncols

number of columns of plots

plotmain

title to go at top of each page of plots

uniqueplots

TRUE means only make unique plots

skipSameXY

TRUE means skip plots that have the same X and Y variable; only applies when uniqueplots=FALSE

save.plots

TRUE means to save plots in a file

type.plots

"pdf" to create pdf files (only if save.plots=T), "eps" to create eps files

latex

TRUE means create LaTeX code to show plots, and have includegraphics line

full.latex

TRUE if want latex output to be a stand-alone file

basename

base name of saved plots

lookup.vec

vector of longer names, where column names should match variable names in tdat

showr

TRUE to include correlation and n in plot heading

use.pch

pch for plotting (in scatter.plot)

use.cex

cex for plotting (in scatter.plot)

wait.between

TRUE if want to wait between screens of plots

...

Other graphical parameters sent to plot

Examples

1
2
3
4
5
test.dat<-data.frame(x=rnorm(10),y=rbinom(10,2,.5))
panelplot.anyKind(test.dat)

test.dat<-data.frame(x=1:10+rnorm(10),y=as.factor(c(rep(1,5),rep(0,5))))
panelplot.anyKind(test.dat)

mathykathy26/kagRfun documentation built on May 29, 2019, 4:40 a.m.