Learn R Programming

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

purrr (version 0.2.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,123,094

Version

0.2.0

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hadley Wickham

Last Published

January 4th, 2016

Functions in purrr (0.2.0)

dmap

Map over the columns of a data frame
flatten

Flatten a list of lists into a simple vector.
conditional-map

Modify elements conditionally
by_row

Apply a function to each row of a data frame
rbernoulli

Generate random samples from a Bernoulli distribution
map

Apply a function to each element of a list.
cross_n

Produce all combinations of list elements
rdunif

Generate random samples from a discrete uniform distribution
by_slice

Apply a function to slices of a data frame
type-predicates

Type predicates
update_list

Modify a list
lmap

Apply a function to list-elements of a list
compose

Compose multiple functions
safely

Capture side effects.
partial

Partial apply a function, filling in some arguments.
keep

Keep or discard elements using a predicate function.
contains

Does a list contain an object?
when

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

Split, order and sort lists by their components.
lift

Lift the domain of a function
accumulate

Accumulate recursive folds across a list
array-coercion

Coerce array to list
%>%

Pipe operator
slice_rows

Slice a data frame into groups of rows
transpose

Transpose a list.
bare-type-predicates

Bare type predicates
at_depth

Map a function over lower levels of a nested list
along

Helper to create vectors with matching length.
prepend

Prepend a vector
splice

Splice objects and lists of objects into a list
flatmap

Map a function and flatten the result by one-level
get-attr

Infix attribute accessor
negate

Negate a predicate function.
every

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

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

Is a formula?
detect

Find the value or position of the first match.
is_empty

Is a vector/list empty?
rerun

Re-run expressions multiple times.
head_while

Find head/tail that all satisfies a predicate.
as_function

Convert an object into a function.
null-default

Default value for NULL.
scalar-type-predicates

Scalar type predicates
set_names

Set names in a vector
as_vector

Coerce a list to a vector
invoke

Invoke functions.
map2

Map over multiple inputs simultaneously.