Learn R Programming

⚠️There's a newer version (1.0.2) of this package.Take me there.

purrr (version 0.1.0)

Functional Programming Tools

Description

Make your pure functions purr with the 'purrr' package. This package completes R's functional programming tools with missing features present in other programming languages.

Copy Link

Version

Install

install.packages('purrr')

Monthly Downloads

1,210,361

Version

0.1.0

License

GPL-3 | file LICENSE

Maintainer

Last Published

September 28th, 2015

Functions in purrr (0.1.0)

lmap

Apply a function to list-subsets of a list
compose

Compose multiple functions
is_formula

Is a formula?
rbernoulli

Generate random samples from a Bernoulli distribution
by_row

Apply a function to each row of a data frame
every

Do every or some elements of a list satisfy a predicate?
flatten

Flatten a list of lists into a list.
cross2

Produce all combinations of list elements
zip_n

Zip lists.
is_empty

Is a vector/list empty?
negate

Negate a predicate function.
map2

Map over multiple inputs simultaneously.
as_vector

Coerce a list to a vector
conditional-map

Modify elements conditionally
contains

Does a list contain an object?
lift

Lift the domain of a function
split_by

Split, order and sort lists by their components.
bare-type-predicates

Bare type predicates
invoke

Invoke every element of a list of functions.
prepend

Prepend a vector
flatmap

Map a function and flatten the result by one-level
slice_rows

Slice a data frame into groups of rows
rerun

Re-run expressions multiple times.
%>%

Pipe operator
reduce

Reduce a list to a single value by iteratively applying a binary function.
array-coercion

Coerce array to list
detect

Find the value or position of the first match.
update_list

Modify a list
when

Match/validate a set of conditions for an object and continue with the action associated with the first valid match.
type-predicates

Type predicates
partial

Partial apply a function, filling in some arguments.
by_slice

Apply a function to slices of a data frame
rdunif

Generate random samples from a discrete uniform distribution
scalar-type-predicates

Scalar type predicates
splice

Splice objects and lists of objects into a list
at_depth

Map a function over lower levels of a nested list
map_call

Map a list to a function call
keep

Keep or discard elements using a predicate function.
head_while

Find head/tail that all satisfies a predicate.
map

Apply a function to each element of a list.