kyotil (version 2016.11-9)

plotting: Plotting Functions

Description

mypostscript and mypdf sets the width and height based on mfrow input.

Usage

abline.pt.slope(pt1, slope, x2=NULL, ...)
abline.pts(pt1, pt2 = NULL)
butterfly.plot(dat, dat2 = NULL, add = FALSE, xaxislabels = rep("", 4), x.ori = 0, xlab = "", ylab = "", cex.axis = 1, ...)
empty.plot()
getMfrow(len)
myhist (x, add.norm=TRUE, col.norm="blue", ...)
myforestplot(dat, xlim=NULL, xlab="", main="", col.1="red", col.2="blue", plot.labels=TRUE,order=FALSE,decreasing=FALSE, vline=TRUE,cols=NULL,log="")
my.interaction.plot(dat, x.ori = 0, xaxislabels = rep("", 2), cex.axis = 1, add = FALSE, xlab = "", ylab = "", pcol = NULL, lcol = NULL, ...)
myboxplot(object, ...)
abline.shade.2(x, col=c(0,1,0)) abline.shade(pt, quadrant=c(1,2,3,4), col=c(0,1,0), alpha=0.3)
"VEplot"(object, X1, X2, x, ...) add.mtext.label (text, cex = 1.4, adj = -0.2) mydev.off(ext = c("pdf", "png", "tiff", "eps"), res = 200, mydev=NULL)
"myboxplot"(formula, data, cex=.5, xlab="", ylab="", main="", box=TRUE, at=NULL, na.action=NULL, pch=1, col=1, test="", reshape.formula=NULL, jitter=TRUE, add.interaction=FALSE, drop.unused.levels = TRUE, ...)
"myboxplot"(object, cex = 0.5, ylab = "", xlab = "", main = "", box = TRUE, at = NULL, pch = 1, col = 1, test = "", ...)
"myboxplot"(object, ...)
mylegend(legend, x, lty = NULL, bty = "n", ...)
mymatplot (x, y, type="b", lty=1:5, pch=NULL, col=1:6, xlab=NULL, ylab="", draw.x.axis=TRUE, bg=NA, lwd=1, at=NULL, make.legend=TRUE, legend=NULL, legend.x=9, legend.title=NULL, legend.cex=1, legend.inset=0, ...) mypairs(dat, ...)
wtd.hist (x, breaks = "Sturges", freq = NULL, probability = !freq, include.lowest = TRUE, right = TRUE, density = NULL, angle = 45, col = NULL, border = NULL, main = paste("Histogram of", xname), xlim = range(breaks), ylim = NULL, xlab = xname, ylab, axes = TRUE, plot = TRUE, labels = FALSE, nclass = NULL, weight = NULL, ...)
myfigure(file = "temp", mfrow = c(1, 1), mfcol = NULL, width = NULL, height = NULL, oma = NULL, mar = NULL, main.outer = FALSE, ...)
mypdf(...)
mypng(...) mytiff(...)
mypostscript(file = "temp", mfrow = c(1, 1), mfcol = NULL, width = NULL, height = NULL, ext = c("eps", "pdf", "png", "tiff"), oma = NULL, mar = NULL, main.outer = FALSE, save2file = TRUE, res = 200, ...)
panel.cor(x, y, digits = 2, prefix = "", cex.cor, ...)
panel.hist(x, ...)
panel.nothing(x, ...)
corplot(object, ...)
"corplot"(object, y, ...)
"corplot"(formula, data, main = "", method = c("pearson", "spearman"), col=1,cex=.5,add.diagonal.line=TRUE,add.lm.fit=FALSE,col.lm=2,add.deming.fit=FALSE, col.deming=4,add=FALSE,log="",same.xylim=FALSE,xlim=NULL,ylim=NULL, ...)

Arguments

add.norm
Boolean, whether to add normal approximation density line
col.norm
string, color of added normal density line
pt1

slope

mydev

jitter
Boolean
add.interaction
Boolean
...

adj

breaks

freq

probability

include.lowest

right

density

angle

border

axes

plot

labels

nclass

weight

pt2

pt

quadrant

alpha

dat

lwd
line width.
res
resolution.
legend.inset
legend inset
dat2

add

text

log
add.lm.fit
add.deming.fit
col.lm
col.deming
reshape.formula
a formula object.
xaxislabels

x.ori

xlab

ylab

cex.axis

len

same.xylim
Boolean. Whether xlim and ylim should be the same
xlim

ylim

main

col.1

col.2

pcol

lcol

object

formula

data

cex

box

at

pch

col

test
string. For example, "t","w","f","k", "tw"
legend

x

X1

X2

lty

bty

type

make.legend

legend.x

legend.title

legend.cex

draw.x.axis

bg

method

file

mfrow

mfcol

width

height

ext

oma

mar

main.outer

save2file

y

digits

prefix

cex.cor
plot.labels
Boolean
order
Boolean
decreasing
Boolean
add.diagonal.line

x2

vline

cols

na.action

drop.unused.levels

Details

myboxplot shows data points along with boxes. The data poins are jittered and the pattern of jittering is made reproducible in repeated calls. The test can only take one type of test currently.

myforestplot is modified from code from Allan deCamp/SCHARP. dat should have three columns. first column should be point estimate, second and third lci and uci, fourth p value. col.1 is the color used for CIs that do not include null, col.2 is used for CIs that do include null. If order is TRUE, the rows are ordered by the first column of dat. descreasing can be used to change the behavior of order.

corplot.formula uses MethComp::Deming by Bendix Carstensen to fit Deming regression.

wtd.hist is copied from weights package.

Examples

Run this code
myfigure(mfrow=c(1,2), file="tmp")
    plot(1:10)
    plot(1:10)
mydev.off(ext="png,pdf")

set.seed(1)
x=1:50+rnorm(50,0,4)
y=1:50+rnorm(50,0,4)
dat=data.frame(x, y)
corplot(y~x,dat,add.lm.fit=TRUE,add.deming.fit=TRUE,col.lm="red",col.deming="blue")

Run the code above in your browser using DataCamp Workspace