Visualize time-based data over time.
visualize_time_at(data = NULL, timebin = NULL, bin = FALSE,
timefloor = NULL, color = NULL, geom = c("bar", "hist"),
add_alpha = FALSE, alpha_range = c(0.25, 1),
scale_manual_base = default_scale_manual(), scale_manual_params = list(),
labs_base = default_labs(), labs_params = list(title = "Count Over Time"),
theme_base = default_theme(panel.grid.major.x = ggplot2::element_blank()),
theme_params = list())
visualize_time(..., timebin, color)
visualize_time_facet_at(..., theme_base = default_theme(panel.grid.major.x =
ggplot2::element_blank()), facet = NULL,
facet_base = default_facet(facet), facet_params = list())
visualize_time_facet(..., timebin, color, facet)
Arguments
| data |
data.frame. |
| timebin |
bare for NSE; character for SE. Name of column in data to use for time axis. |
| bin |
logical. Whether or not to call lubridate::floor_date() to truncate timebin. |
| timefloor |
character. Name of column passed directly to unit parameter of
lubridate::floor_date() if bin = FALSE. |
| color |
bare for NSE; character for SE. Name of column in data to use for color basis.
Even if fill is the actual ggplot2 aesthetic, the internal code will 'coerce' this
column to fill.
In order to simplify internal code, MUST be specified. |
| geom |
character. 'bar' or 'hist'. 'bar' is probably best for everything except Date objects. |
| add_alpha |
logical. Whether or not to use ggplot2::scale_alpha() based on count. |
| alpha_range |
numeric (vector). Direct parameter passed to range parameter
of ggplot2::scale_alpha(). |
| scale_manual_base |
list. Parameters to pass to ggplot2::scale_fill_manual() or
ggplot2::scale_color_manual(), depending on the aesthetic mapping. A default values
argument is specified in the internal
function default_scale_manual(),
so if overwriting explicitly, then values should be included in the list. |
| scale_manual_params |
list. Additional parameters to pass to ggplot2::scale_fill_manual()
or ggplot2::scale_color_manual() (e.g. breaks, labels, or name).
The default values specified by scale_manual_base = default_scale_manual()
can be overwritten a values argument in this list (or directly with a
values argument in the scale_manual_base list. |
| labs_base |
ggplot2::labs() function. Defaults to a pre-determined set of values.
It is recommended NOT to modify this argument; isntead, the _params argument should
be used for customization.
|
| labs_params |
list. Additional parameters to pass to ggplot2::labs() to use in addition
to and/or override the parameters set in the _base parameter. |
| theme_base |
ggplot2::theme() function. (e.g. as ggplot2::theme_minimal().)
A custom theme is supplied as a default. As with the the labs_base argument, it is NOT
recommended to change this directly.
|
| theme_params |
list. Additional parameters to pass to ggplot2::labs().
Should be used in the same manner as labs_params for customization. |
| ... |
dots. Parameters to pass directly to visualize_time(). |
| facet |
bare for NSE; character for SE. Name of column in data to use for facetting. |
| facet_base |
ggplot2::facet_wrap() function. An internal function
sets defaults for facets, scales, ncol, nrow, and strip.position
As with the labs_base and theme_base arguments, it is NOT recommended to set
this argument explicitly; instead, the accompanying _params argument should be used.
|
| facet_params |
list. Additional parameters to pass to ggplot2::facet_wrap(). Parameters
passed to this argument override thos in the _base argument. |
Value
gg
Details
facet version is for facetting. Lists are used for
customization arguments (instead of dots) because there
are multiple arguments that can be customized.
See also
https://juliasilge.com/blog/ten-thousand-tweets/.