Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. R
  3. purrr

purrr

NOASSERTIONRv1.2.2

A functional programming toolkit for R that enhances data manipulation with consistent, type-stable functions for working with vectors and lists.

Visit WebsiteGitHubGitHub
1.4k stars293 forks0 contributors

What is purrr?

purrr is an R package that provides a functional programming toolkit for working with vectors and lists. It enhances R's capabilities by offering a consistent set of functions like `map()` to replace for loops, making code more succinct and easier to read. It solves the problem of repetitive iteration and data manipulation tasks in R.

Target Audience

R developers and data scientists, particularly those working within the tidyverse ecosystem, who need to perform iterative operations on data structures like lists and vectors.

Value Proposition

Developers choose purrr for its type-stable functions, seamless integration with the pipe operator, and flexibility in handling different input types. Its consistent API and support for progress tracking and parallel processing make it a robust alternative to base R loops.

Overview

A functional programming toolkit for R

Use Cases

Best For

  • Applying functions to each element of a list or vector without using for loops
  • Performing type-stable transformations on data structures in R
  • Simplifying complex data manipulation pipelines with the pipe operator
  • Tracking progress of long-running iterative jobs in R
  • Parallelizing computations across multiple cores or machines in R
  • Extracting components from nested data structures using flexible input methods

Not Ideal For

  • Projects that rely solely on base R's apply functions and see no need for additional consistency
  • Environments with minimal dependency requirements where adding the tidyverse is prohibitive
  • Performance-critical applications where vectorized base R operations outperform functional calls

Pros & Cons

Pros

Type-Stable Functions

All map functions return predictable types; for example, map() always outputs a list, and map_dbl() ensures a double vector, reducing runtime errors as highlighted in the README's comparison to base R.

Seamless Pipe Integration

The first argument is always data, making it natural to use with the pipe operator (|>), enabling readable pipelines like in the mtcars example for fitting models across groups.

Flexible Input Methods

map() accepts functions, character vectors for name-based extraction, or numeric vectors for position-based extraction, offering versatile ways to apply operations without boilerplate code.

Progress and Parallel Support

Built-in .progress argument for tracking long jobs and compatibility with in_parallel() for easy multi-core or distributed computing, as mentioned in the README's key features.

Cons

Tidyverse Ecosystem Lock-in

Using purrr often encourages dependency on other tidyverse packages, which can bloat projects if only functional programming tools are needed, limiting flexibility in lean environments.

Performance Overhead

Functional calls may introduce slight overhead compared to highly optimized base R vectorized operations, especially for large datasets where loops or apply functions might be more efficient.

Learning Curve for FP

Requires understanding of functional programming concepts, which can be a barrier for R users accustomed to imperative loops, as the README notes it's best learned from external resources like R for Data Science.

Frequently Asked Questions

Quick Stats

Stars1,396
Forks293
Contributors0
Open Issues25
Last commit1 month ago
CreatedSince 2014

Tags

#functional-programming#parallel-computing#vector-operations#r-package#type-safety#r#tidyverse#iteration#data-manipulation

Built With

R
R

Links & Resources

Website

Included in

R6.4k
Auto-fetched 1 day ago

Related Projects

awesome-awesomenessawesome-awesomeness

A curated list of awesome awesomeness

Stars33,486
Forks3,607
Last commit2 years ago
prophet <img class="emoji" alt="heart" src="https://cdn.jsdelivr.net/gh/qinwf/awesome-R@3c66da6e291bcc0520b1649125b0bed750896a9a/heart.png" height="20" align="absmiddle" width="20">prophet <img class="emoji" alt="heart" src="https://cdn.jsdelivr.net/gh/qinwf/awesome-R@3c66da6e291bcc0520b1649125b0bed750896a9a/heart.png" height="20" align="absmiddle" width="20">

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.

Stars20,227
Forks4,629
Last commit1 month ago
listslists

The definitive list of lists (of lists) curated on GitHub and elsewhere

Stars11,256
Forks766
Last commit2 months ago
PatchworkPatchwork

The Composer of ggplots

Stars2,610
Forks170
Last commit9 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub