plotting {kyotil} | R Documentation |
Plotting Functions
Description
mypostscript and mypdf sets the width and height based on mfrow input.
Usage
myplot (object, ...)
## S3 method for class 'loess'
myplot(object, xlab="x", ylab="fitted", ...)
whiskers (x, s, ...)
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()
add.mtext.label (text, cex = 1.4, adj = -0.2)
mydev.off(file = "temp", ext = c("pdf"), res = 200, mydev =
NULL, silent = TRUE)
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 =
"", null.val = NULL)
my.interaction.plot(dat, x.ori = 0, xaxislabels = rep("", 2), cex.axis = 1, add = FALSE,
xlab = "", ylab = "", pcol = NULL, lcol = NULL, ...)
myboxplot(object, ...)
## S3 method for class 'formula'
myboxplot(formula, data, cex = 0.5, xlab = "", ylab = "", main =
"", box = TRUE, at = NULL, na.action = NULL, p.val =
NULL, pch = 1, col = 1, test = "",
friedman.test.formula = NULL, reshape.formula = NULL,
reshape.id = NULL, jitter = TRUE, add.interaction =
FALSE, drop.unused.levels = TRUE, bg.pt = NULL, add =
FALSE, seed = 1, write.p.at.top = FALSE, ...)
## S3 method for class 'data.frame'
myboxplot(object, cex = 0.5, ylab = "", xlab = "", main = "",
box = TRUE, at = NULL, pch = 1, col = 1, test = "",
paired = FALSE, ...)
## S3 method for class 'list'
myboxplot(object, paired = FALSE, ...)
abline.shade.2(x, col=c(0,1,0))
abline.shade(pt, type = 5, col = c(0, 1, 0), alpha = 0.3)
mylegend(legend, x, y=NULL, lty = NULL, bty = "n", ...)
mymatplot(x, y, type = "b", lty = c(1, 2, 1, 2, 1, 2), pch =
NULL, col = rep(c("darkgray", "black"), each = 3),
xlab = NULL, ylab = "", draw.x.axis = TRUE, bg = NA,
lwd = 1, at = NULL, make.legend = TRUE, legend = NULL,
impute.missing.for.line = TRUE, legend.x = 9,
legend.title = NULL, legend.cex = 1, legend.lty = lty,
legend.inset = 0, xaxt = "s", y.intersp = 1.5,
x.intersp = 0.3, text.width = NULL, add = FALSE, ...
)
mypairs(dat, ladder = FALSE, show.data.cloud = TRUE,
ladder.add.line = T, ladder.add.text = T, ...)
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,
...)
mylines(x, y, type = "l", ...)
myfigure(mfrow = c(1, 1), mfcol = NULL, width = NULL,
height = NULL, oma = NULL, mar = NULL, main.outer = FALSE, bg=NULL)
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, silent = TRUE, ...)
panel.cor(x, y, digits = 2, prefix = "", cex.cor, cor., leading0
= FALSE, cex.cor.dep = TRUE, ...)
panel.hist(x, ...)
panel.nothing(x, ...)
corplot(object, ...)
## Default S3 method:
corplot(object, y, ...)
## S3 method for class 'formula'
corplot(formula, data, main = "", method = c("pearson",
"spearman"), col = 1, cex = 0.5, add.diagonal.line =
TRUE, add.lm.fit = FALSE, add.loess.fit = FALSE,
col.lm = 2, add.deming.fit = FALSE, col.deming = 4,
add = FALSE, log = "", same.xylim = FALSE, xlim =
NULL, ylim = NULL, ...)
Arguments
silent |
tbdadd |
legend.lty |
tbdadd |
cex.cor.dep |
tbdadd |
add.loess.fit |
tbdadd |
leading0 |
tbdadd |
null.val |
tbdadd |
write.p.at.top |
tbdadd |
text.width |
tbdadd |
text |
tbdadd |
cex |
tbdcex |
adj |
tbdpt2 |
file |
tbdfile |
ext |
tbdext |
res |
resolution. |
add.norm |
Boolean, whether to add normal approximation density line |
col.norm |
string, color of added normal density line |
pt1 |
tbdpt1 |
s |
tbdslope |
ladder |
tbdslope |
slope |
tbdslope |
friedman.test.formula |
tbdslope |
reshape.id |
tbdslope |
impute.missing.for.line |
tbdslope |
cor. |
tbdslope |
mydev |
tbdslope |
jitter |
Boolean |
add.interaction |
Boolean |
... |
tbd... |
xaxt |
tbdpt2 |
breaks |
tbdpt2 |
freq |
tbdpt2 |
bg.pt |
tbdpt2 |
probability |
tbdpt2 |
include.lowest |
tbdpt2 |
right |
tbdpt2 |
density |
tbdpt2 |
angle |
tbdpt2 |
border |
tbdpt2 |
axes |
tbdpt2 |
plot |
tbdpt2 |
labels |
tbdpt2 |
nclass |
tbdpt2 |
weight |
tbdpt2 |
pt2 |
tbdpt2 |
pt |
tbdpt2 |
alpha |
tbdpt2 |
dat |
tbddat |
lwd |
line width. |
x.intersp |
controls the look of legend. |
y.intersp |
controls the look of legend. |
legend.inset |
legend inset |
dat2 |
tbddat2 |
add |
tbdadd |
log |
log |
add.lm.fit |
lm fit |
add.deming.fit |
add |
col.lm |
col |
col.deming |
col |
reshape.formula |
a formula object. |
xaxislabels |
tbdxaxislabels |
x.ori |
tbdx.ori |
xlab |
tbdxlab |
ylab |
tbdylab |
cex.axis |
tbdcex.axis |
len |
tbdlen |
same.xylim |
Boolean. Whether xlim and ylim should be the same |
xlim |
tbdxlim |
ylim |
tbdxlim |
main |
tbdmain |
col.1 |
tbdcol.1 |
col.2 |
tbdcol.2 |
pcol |
tbdpcol |
lcol |
tbdlcol |
object |
tbdobject |
formula |
tbdformula |
data |
tbddata |
box |
tbdbox |
at |
tbdat |
pch |
tbdpch |
col |
tbdcol |
test |
string. For example, "t","w","f","k", "tw" |
legend |
tbdlegend |
x |
tbdx |
lty |
tbdlty |
bty |
tbdbty |
type |
tbdtype |
make.legend |
tbdmake.legend |
legend.x |
tbdlegend.x |
legend.title |
tbdlegend.title |
legend.cex |
tbdlegend.cex |
draw.x.axis |
tbddraw.x.axis |
bg |
tbdbg |
method |
tbdmethod |
mfrow |
tbdmfrow |
mfcol |
tbdmfcol |
width |
tbdwidth |
height |
tbdheight |
oma |
tbdoma |
mar |
tbdmar |
main.outer |
tbdmain.outer |
save2file |
tbdsave2file |
y |
tbdy |
digits |
tbddigits |
prefix |
tbdprefix |
cex.cor |
cex cor |
plot.labels |
Boolean |
order |
Boolean |
decreasing |
Boolean |
add.diagonal.line |
tbdadd.diagonal.line |
x2 |
tbdadd.diagonal.line |
vline |
tbdadd.diagonal.line |
cols |
tbdadd.diagonal.line |
na.action |
tbdadd.diagonal.line |
drop.unused.levels |
tbdadd.diagonal.line |
p.val |
tbdx |
seed |
tbdx |
paired |
tbdx |
show.data.cloud |
tbdx |
ladder.add.line |
tbdx |
ladder.add.text |
tbdx |
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, author: Josh Pasek.
mymatplot will use na.approx (zoo) to fill in NA before plotting in order to draw continuous lines. The filled-in values will not be shown as points.
Examples
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")
dat=data.frame(y=c(1:10,2:11), x=rep(c("a","b"),each=10), ptid=c(1:10,1:10))
par(mfrow=c(1,2))
myboxplot(y~x, dat, test="w", jitter=FALSE)
myboxplot(y~x, dat, test="f", add.interaction=TRUE, reshape.formula=y~x, reshape.id="ptid")
myboxplot(list(jitter(1:10), jitter(3:12)), test="w")
myboxplot(list(jitter(1:10), jitter(3:12)), test="w", paired=TRUE)
## Not run:
myfigure(mfrow=c(1,2))
plot(1:10)
plot(1:10)
mydev.off(ext="png,pdf", file="tmp")
## End(Not run)
#myboxplot x axis may look weird if log="xy"