View source: R/2_ggproto_visualize.r
proto_hex | R Documentation |
Adds geom_hex()
of the projected data. Does not display hexagons in plotly
animations; will not work with animate_plotly()
.
proto_hex(
aes_args = list(),
identity_args = list(),
row_index = NULL,
bins = 30
)
aes_args |
A list of arguments to call inside of aes().
aesthetic mapping of the primary geom. For example,
|
identity_args |
A list of static, identity arguments passed into
the primary geom. For instance,
|
row_index |
A numeric or logical index of rows to subset to. Defaults to NULL, all observations. |
bins |
Numeric vector giving number of bins in both vertical and horizontal directions. Defaults to 30. |
Other ggtour proto functions:
append_fixed_y()
,
facet_wrap_tour()
,
ggtour()
,
proto_basis()
,
proto_default()
,
proto_density()
,
proto_density2d()
,
proto_highlight()
,
proto_hline0()
,
proto_origin()
,
proto_point()
,
proto_text()
library(spinifex)
raw <- ggplot2::diamonds
dat <- scale_sd(raw[1:10000, c(1, 5:6, 8:10)])
gt_path <- save_history(dat, grand_tour(), max = 3)
## 10000 rows is quite heavy to animate.
## Increase performance by aggregating many points into few hexagons
ggp <- ggtour(gt_path, dat) +
proto_basis() +
proto_hex(bins = 20)
## Hexagons don't show up in plotly animation.
## Not run:
animate_gganimate(ggp)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.