trelliscopejs (version 0.1.13)

cogs: Cogs Wrapper Function

Description

Cogs Wrapper Function

Usage

cogs(.x, .f, ...)

Arguments

.x

a list or atomic vector (see map for details)

.f

a function, formula, or atomic vector (see map for details)

...

additional arguments passed on to .f (see map for details)

Details

See map

Examples

Run this code
# NOT RUN {
library(dplyr)
library(tidyr)
ggplot2::mpg %>%
  group_by(manufacturer, class) %>%
  nest() %>%
  mutate(
    additional_cogs = map_cog(data,
      ~ data_frame(
        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, ~ figure(xlab = "City mpg", ylab = "Highway mpg") %>%
      ly_points(cty, hwy, data = .x))) %>%
  trelliscope(name = "city_vs_highway_mpg", nrow = 1, ncol = 2)
# }

Run the code above in your browser using DataLab