Learn R Programming

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

purrr (version 0.2.1)

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,257,542

Version

0.2.1

License

GPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hadley Wickham

Last Published

February 12th, 2016

Functions in purrr (0.2.1)

by_slice

Apply a function to slices of a data frame
as_function

Convert an object into a function.
as_vector

Coerce a list to a vector
is_empty

Is a vector/list empty?
flatmap

Map a function and flatten the result by one-level
conditional-map

Modify elements conditionally
type-predicates

Type predicates
flatten

Flatten a list of lists into a simple vector.
is_formula

Is a formula?
invoke

Invoke functions.
rdunif

Generate random samples from a discrete uniform distribution
map2

Map over multiple inputs simultaneously.
by_row

Apply a function to each row of a data frame
contains

Does a list contain an object?
%>%

Pipe operator
scalar-type-predicates

Scalar type predicates
set_names

Set names in a vector
negate

Negate a predicate function.
partial

Partial apply a function, filling in some arguments.
bare-type-predicates

Bare type predicates
map

Apply a function to each element of a list.
update_list

Modify a list
dmap

Map over the columns of a data frame
get-attr

Infix attribute accessor
safely

Capture side effects.
lift

Lift the domain of a function
accumulate

Accumulate recursive folds across a list
transpose

Transpose a list.
at_depth

Map a function over lower levels of a nested list
null-default

Default value for NULL.
reduce

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

Find the value or position of the first match.
array-coercion

Coerce array to list
slice_rows

Slice a data frame into groups of rows
splice

Splice objects and lists of objects into a list
split_by

Split, order and sort lists by their components.
along

Helper to create vectors with matching length.
keep

Keep or discard elements using a predicate function.
compose

Compose multiple functions
prepend

Prepend a vector
when

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

Apply a function to list-elements of a list
cross_n

Produce all combinations of list elements
rerun

Re-run expressions multiple times.
head_while

Find head/tail that all satisfies a predicate.
every

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

Generate random samples from a Bernoulli distribution