r <- reducer(initialfn = "() => 0",
reducefn = "(x, y) => Math.max(x, y)",
name = "max")
create_schema(mtcars) |>
add_barplot(c("cyl", "mpg"), options = list(reducer = r))
Run the code above in your browser using DataLab