Description Usage Arguments Author(s) See Also Examples
Plot observations as dots.
1 2 3 |
x |
A numerical vector. |
fact |
A character or factor vector defining the grouping for data in |
vertical |
If |
at |
The vertical coordinate of the points, or the horizontal coordinate if |
key |
The factor levels corresponding to |
pch |
Plotting character. If |
col |
Plotting character color. If |
cex |
Plotting character size. If |
add |
If |
axes |
If |
xlim |
Limits for the x axis. |
ylim |
Limits for the y axis. |
... |
Additional arguments to be passed to |
David Diez
histPlot
, densityPlot
, boxPlot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #===> example 1 <===#
data(cars)
dotPlot(cars$price, cars$type, key=c('large', 'midsize', 'small'), cex=1:3)
#===> example 2 <===#
data(run10)
layout(matrix(1:2,2), heights=c(2.7,1.5))
par(las=1)
these <- run10$gender=='M'
dotPlot(run10$time[these], run10$div[these],
col=fadeColor('black', '11'))
# disorganized levels in the above plot, which we could
# organize with key. an example of organizing the levels...
dotPlot(run10$time[these], run10$div[these],
col=fadeColor('black', '11'),
key=c('20-24', '25-29', '30-34', '35-39'))
par(las=0, mfrow=c(1,1))
#===> example 3 <===#
data(marioKart)
dotPlot(marioKart$totalPr, marioKart$cond, ylim=c(0.5,2.5),
xlim=c(25, 80), cex=1) # miss the outliers
boxPlot(marioKart$totalPr, marioKart$cond, add=1:2+0.1,
key=c('new', 'used'), horiz=TRUE, axes=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.