Learn R Programming

kyotil (version 2015.11-13)

plotting: Plotting Functions

Description

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

Usage

abline.pt.slope(pt1, slope, ...)
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)
myforestplot(dat, xlim = NULL, xlab = "", main = "", col.1 = "red", col.2 = "blue", plot.labels=TRUE,order=FALSE,decreasing=FALSE)
my.interaction.plot(dat, x.ori = 0, xaxislabels = rep("", 2), cex.axis = 1, add = FALSE, xlab = "", ylab = "", pcol = NULL, lcol = NULL, ...)
myboxplot(object, ...)
"myboxplot"(formula, data, cex=.5, ylab="", xlab="", main="", box=TRUE, at=NULL, pch=1, col=1, test="", reshape.formula=NULL, jitter=TRUE, add.interaction=FALSE, ...)
"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, ...)
mypdf(...)
mypostscript(file = "temp", mfrow = c(1, 1), mfcol = NULL, width = NULL, height = NULL, ext = "eps", oma = NULL, mar = NULL, main.outer = FALSE, save2file = TRUE, ...)
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

pt1

slope

jitter
Boolean
add.interaction
Boolean
...

pt2

dat

lwd
line width.
legend.inset
legend inset
dat2

add

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

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

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.

Examples

Run this code
mypdf(mfrow=c(1,2))
    plot(1:10)
    plot(1:10)
dev.off()

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 DataLab