scatter.box.mosaic.plot: Quick Adaptive Plotting Function for Exploratory Analyses

Description Usage Arguments Examples

Description

Function to make many scatterplots, boxplots and mosaic plots as necessary for exploratory analyses. Includes the Spearman correlation coefficient and sample size in the plot title. Correlation coefficients for plots with any categorical variables are calculated after converting the factors to numeric. The titles are printed in red if the correlation is significant. Significance is tested by the method appropriate to the variable: scatterplots use Spearman's test, boxplots use Kruskal-Wallis and mosaics use Chi-Square test.

Usage

1
2
3
scatter.box.mosaic.plot(tdat, yname, xname, long.yname = NULL,
  long.xname = NULL, showr = TRUE, use.pch = 1, use.cex = 1, jitx = 0,
  jity = 0, addtomain = NULL, cex.xylab = 1.5, cex.title = 1.2, ...)

Arguments

yname

name of variable from tdat to plot on y-axis

xname

name of variable from tdat to plot on x-axis

long.yname

character string to be put on y-axis

long.xname

character string to be put on x-axis

showr

TRUE means include correlation and n on plot heading

use.pch

pch symbol to be used in plot

use.cex

cex (character expansion) for plotting symbols

jitx

factor component of jitter(x,factor=jitx)

jity

factor component of jitter(y,factor=jity)

addtomain

additional text for main title (if showr=FALSE, this is the entire title)

cex.xylab

cex for x and y axes

cex.title

cex for title (and correlation, if shown)

...

Other graphical parameters sent to plot

Examples

1
2
3
4
5
test.dat<-data.frame(x=rnorm(10),y=rbinom(10,2,.5))
scatter.box.mosaic.plot(test.dat,yname="y",xname="x")

test.dat<-data.frame(x=1:10+rnorm(10),y=as.factor(c(rep(1,5),rep(0,5))))
scatter.box.mosaic.plot(test.dat,yname="y",xname="x")

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