Description Usage Arguments Details See Also Examples
Draw a univariate density plot, with a rug plot underneath.
1 2 |
x |
variable name which designates variable displayed on the horizontal axis |
data |
a mutaframe created by |
main |
the main title |
xlim |
a numeric vector of length 2 (like |
ylim |
y-axis limits; similar to |
xlab |
x-axis title |
ylab |
y-axis title |
binwidth |
the bin width ( |
Common interactions are documented in common_key_press
.
Specific interactions include: Arrow Up
/Down
in-/de-creases
size of points; Arrow Left
/Right
de-/in-creases binwidth for
density; Key Z
toggle zoom on/off (default is off); mouse click &
drag will specify a zoom window.
Note there are two short tickmarks in the plot denoting the binwidth.
Other plots: qbar
; qboxplot
;
qhist
, qspine
;
qmval
; qparallel
;
qtime
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | library(cranvas)
### (1) ames housing data
qames <- qdata(ameshousing)
qdensity(saleprice, data = qames)
### (2) tennis data
qtennis <- qdata(tennis)
qdensity(first.serve.pct, data = qtennis)
qdensity(second.serve.pts, data = qtennis)
qdensity(serve.speed, data = qtennis)
record_selector(name, data = qtennis)
### (3) pollen data
if (require("animation")) {
data(pollen, package = "animation")
qpollen <- qdata(pollen)
print(qdensity(RIDGE, data = qpollen))
}
### (4) flea (with colors)
data(flea, package = "tourr")
qflea <- qdata(flea, color = species)
qdensity(tars1, data = qflea)
qdensity(tars2, data = qflea)
qdensity(aede1, data = qflea)
qdensity(aede3, data = qflea)
cranvas_off()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.