cogs {trelliscopejs} | R Documentation |
Cogs Wrapper Function
Description
Cogs Wrapper Function
Usage
cogs(.x, .f, ...)
Arguments
.x |
a list or atomic vector (see |
.f |
a function, formula, or atomic vector (see |
... |
additional arguments passed on to .f (see |
Details
See map
Examples
library(dplyr)
library(tidyr)
library(plotly)
ggplot2::mpg %>%
nest(data = !one_of(c("manufacturer", "class"))) %>%
mutate(
additional_cogs = map_cog(data, function(x) {
tibble(
max_city_mpg = cog(max(x$cty), desc = "Max city mpg"),
min_city_mpg = cog(min(x$cty), desc = "Min city mpg"))
}),
panel = map_plot(data, function(x) {
plot_ly(data = x, x = ~cty, y = ~hwy,
type = "scatter", mode = "markers")
})
) %>%
trelliscope(name = "city_vs_highway_mpg", nrow = 1, ncol = 2)
[Package trelliscopejs version 0.2.6 Index]