From 4a815cb81adfa4585b4917ad804d35f6fbed7751 Mon Sep 17 00:00:00 2001 From: Fonti Kar Date: Thu, 15 Aug 2024 14:15:07 -0700 Subject: [PATCH] Very rough outline with Sierra #915 --- vignettes/purrr.Rmd | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 vignettes/purrr.Rmd diff --git a/vignettes/purrr.Rmd b/vignettes/purrr.Rmd new file mode 100644 index 00000000..cc34e2c7 --- /dev/null +++ b/vignettes/purrr.Rmd @@ -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 + + +