datamation_sanddance.Rd
Create a plot datamation from a tidyverse pipeline.
datamation_sanddance(
pipeline,
envir = rlang::global_env(),
pretty = TRUE,
elementId = NULL,
height = 300,
width = 300
)
Tidyverse pipeline
Environment where code is evaluated. Defaults to the global environment.
Whether to pretty the JSON output. Defaults to TRUE.
Optional ID for the widget element.
Height of the plotting area of the widget (excluding axes and legends). This is an approximation and not an exact science, since sizes may vary depending on labels, legends, facets, etc! Defaults to 300 (pixels).
Width of the plotting area of the widget (excluding axes and legends). This is an approximation and not an exact science, since sizes may vary depending on labels, legends, facets, etc! Defaults to 300 (pixels).
{
library(dplyr)
"small_salary %>%
group_by(Degree) %>%
summarize(mean = mean(Salary))" %>%
datamation_sanddance()
library(ggplot2)
"small_salary %>%
group_by(Work, Degree) %>%
summarize(mean_salary = mean(Salary)) %>%
ggplot(aes(x = Work, y = mean_salary)) +
geom_point() +
facet_grid(rows = vars(Degree))" %>%
datamation_sanddance()
}
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
#> Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in
#> dplyr 1.1.0.
#> ℹ Please use `reframe()` instead.
#> ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
#> always returns an ungrouped data frame and adjust accordingly.
#> ℹ The deprecated feature was likely used in the datamations package.
#> Please report the issue to the authors.