-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: "purrr" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{purrr} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
library(purrr) | ||
``` | ||
|
||
[Big picture] | ||
|
||
The purrr package makes applying your functions to multiple elements of a list or data frame easy but you don't need a `for` loop. | ||
|
||
|
||
### The purrr function families | ||
|
||
- `map` apply function mulitple times/ multplie outputs | ||
- `reduce` 1 output | ||
- `predicate` TRUE/FALSE logical output | ||
|
||
### `map()` | ||
|
||
Detailled map example | ||
|
||
### `reduce`()` | ||
|
||
Detailled map example | ||
|
||
### `predicate`()` | ||
|
||
Detailled map example | ||
|
||
|
||
|