Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reduce

Reduce a list to a single value by iteratively applying a binary function


Description

Inspired by reduce() from the purrr package

Usage

reduce(.x, .f, ..., .init)

Arguments

.x

A list or atomic vector.

.f

A 2-argument function. The function will be passed the accumulated value as the first argument and the "next" value as the second argument.

...

Additional arguments passed on to .f.

.init

If supplied, will be used as the first value to start the accumulation, rather than using x[[1]]. This is useful if you want to ensure that reduce returns a correct value when .x is empty. If missing, and x is empty, will throw an error.

Author(s)

Jonathon Love jon@thon.cc


ggridges

Ridgeline Plots in 'ggplot2'

v0.5.3
GPL-2 | file LICENSE
Authors
Claus O. Wilke [aut, cre] (<https://orcid.org/0000-0002-7470-9261>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.