linechart {mining} | R Documentation |
Plot each data row as a curve.
linechart(y,se=NULL,effects=F,med=F, xscale=c("equal","linear","none"),...)
y |
a named vector or matrix. |
se |
a vector or matrix, same size as y , of error bounds.
Alternatively, y can be list(y,se) . |
effects |
If TRUE , the columns are shifted to have zero
mean. |
med |
If TRUE and effects=TRUE , the columns are
shifted to have zero median. |
xscale |
describes how the columns should be placed. |
... |
additional arguments to labeled.curves . |
If xscale="linear"
, the columns are placed to make each curve
as straight as possible.
If xscale="equal"
, the columns are placed similar to
"linear"
but with the constraint that they must be equally
spaced.
If xscale="none"
, the columns are placed in the order that
they appear in the matrix. This is automatic if y
has ordered
columns (see dim.ordered
).
If se != NULL
, error bars are drawn around each point.
Linecharts are a replacement for dotcharts and mosaics.
Tom Minka
# compare to a dotchart data(VADeaths) dotchart(VADeaths, main = "Death Rates in Virginia - 1940") dimOrdered(VADeaths)[2] = F linechart(VADeaths) linechart(t(VADeaths)) # compare to a mosaicplot data(HairEyeColor) x <- margin.table(HairEyeColor,c(1,2)) dimOrdered(x) = F mosaicplot(x) x = t(x) col = c("brown","blue","red","green") linechart(row.probs(x),color.pal=col) linechart(row.probs(x,se=T),color.pal=col) linechart(row.probs(x,se=T),jitter=0.02,color.pal=col) mosaicplot(x) linechart(row.probs(t(x),se=T)) data(blood) dimOrdered(blood) = F linechart(row.probs(blood,se=T)) data(antacids) dimOrdered(antacids) = F linechart(row.probs(antacids,se=T)) mosaicplot(t(antacids))