Skip to content

Commit e4b2700

Browse files
authored
Base vignette update (#1211)
* Remove superseded and deprecated functions from base vignette * Add link to `map_vec()` in `map_raw` docs
1 parent b867f05 commit e4b2700

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

R/map-raw.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' `r lifecycle::badge("deprecated")`
55
#'
66
#' These functions were deprecated in purrr 1.0.0 because they are of limited
7-
#' use and you can now use `map_vec()` instead. They are variants of [map()],
7+
#' use and you can now use [map_vec()] instead. They are variants of [map()],
88
#' [map2()], [imap()], [pmap()], and [flatten()] that return raw vectors.
99
#'
1010
#' @keywords internal

man/map_raw.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/base.Rmd

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,27 @@ See function documentation for the details.
5555

5656
Here `x` denotes a vector and `f` denotes a function
5757

58-
| Output | Input | Base R | purrr |
58+
| Output | Input | Base R | purrr |
5959
|------------------|------------------|------------------|-------------------|
60-
| List | 1 vector | `lapply()` | `map()` |
61-
| List | 2 vectors | `mapply()`, `Map()` | `map2()` |
62-
| List | \>2 vectors | `mapply()`, `Map()` | `pmap()` |
63-
| Atomic vector of desired type | 1 vector | `vapply()` | `map_lgl()` (logical), `map_int()` (integer), `map_dbl()` (double), `map_chr()` (character), `map_raw()` (raw) |
64-
| Atomic vector of desired type | 2 vectors | `mapply()`, `Map()`, then `is.*()` to check type | `map2_lgl()` (logical), `map2_int()` (integer), `map2_dbl()` (double), `map2_chr()` (character), `map2_raw()` (raw) |
65-
| Atomic vector of desired type | \>2 vectors | `mapply()`, `Map()`, then `is.*()` to check type | `pmap_lgl()` (logical), `pmap_int()` (integer), `pmap_dbl()` (double), `pmap_chr()` (character), `pmap_raw()` (raw) |
66-
| Side effect only | 1 vector | loops | `walk()` |
67-
| Side effect only | 2 vectors | loops | `walk2()` |
68-
| Side effect only | \>2 vectors | loops | `pwalk()` |
69-
| Data frame (`rbind` outputs) | 1 vector | `lapply()` then `rbind()` | `map_dfr()` |
70-
| Data frame (`rbind` outputs) | 2 vectors | `mapply()`/`Map()` then `rbind()` | `map2_dfr()` |
71-
| Data frame (`rbind` outputs) | \>2 vectors | `mapply()`/`Map()` then `rbind()` | `pmap_dfr()` |
72-
| Data frame (`cbind` outputs) | 1 vector | `lapply()` then `cbind()` | `map_dfc()` |
73-
| Data frame (`cbind` outputs) | 2 vectors | `mapply()`/`Map()` then `cbind()` | `map2_dfc()` |
74-
| Data frame (`cbind` outputs) | \>2 vectors | `mapply()`/`Map()` then `cbind()` | `pmap_dfc()` |
75-
| Any | Vector and its names | `l/s/vapply(X, function(x) f(x, names(x)))` or `mapply/Map(f, x, names(x))` | `imap()`, `imap_*()` (`lgl`, `dbl`, `dfr`, and etc. just like for `map()`, `map2()`, and `pmap()`) |
76-
| Any | Selected elements of the vector | `l/s/vapply(X[index], FUN, ...)` | `map_if()`, `map_at()` |
77-
| List | Recursively apply to list within list | `rapply()` | `map_depth()` |
78-
| List | List only | `lapply()` | `lmap()`, `lmap_at()`, `lmap_if()` |
60+
| List | 1 vector | `lapply()` | `map()` |
61+
| List | 2 vectors | `mapply()`, `Map()` | `map2()` |
62+
| List | \>2 vectors | `mapply()`, `Map()` | `pmap()` |
63+
| Atomic vector of desired type | 1 vector | `vapply()` | `map_lgl()` (logical), `map_int()` (integer), `map_dbl()` (double), `map_chr()` (character), `map_vec()` (other vectors) |
64+
| Atomic vector of desired type | 2 vectors | `mapply()`, `Map()`, then `is.*()` to check type | `map2_lgl()` (logical), `map2_int()` (integer), `map2_dbl()` (double), `map2_chr()` (character), `map2_vec()` (other vectors) |
65+
| Atomic vector of desired type | \>2 vectors | `mapply()`, `Map()`, then `is.*()` to check type | `pmap_lgl()` (logical), `pmap_int()` (integer), `pmap_dbl()` (double), `pmap_chr()` (character), `pmap_vec()` (other vectors) |
66+
| Side effect only | 2 vectors | loops | `walk2()` |
67+
| Side effect only | 1 vector | loops | `walk()` |
68+
| Side effect only | \>2 vectors | loops | `pwalk()` |
69+
| Data frame (`rbind` outputs) | 1 vector | `lapply()` then `rbind()` | `map()` then `list_rbind()` |
70+
| Data frame (`rbind` outputs) | 2 vectors | `mapply()`/`Map()` then `rbind()` | `map2()` then `list_rbind()` |
71+
| Data frame (`rbind` outputs) | \>2 vectors | `mapply()`/`Map()` then `rbind()` | `pmap()` then `list_rbind()` |
72+
| Data frame (`cbind` outputs) | 1 vector | `lapply()` then `cbind()` | `map()` then `list_cbind()` |
73+
| Data frame (`cbind` outputs) | 2 vectors | `mapply()`/`Map()` then `cbind()` | `map2()` then `list_cbind()` |
74+
| Data frame (`cbind` outputs) | \>2 vectors | `mapply()`/`Map()` then `cbind()` | `pmap()` then `list_cbind()` |
75+
| Any | Vector and its names | `l/s/vapply(X, function(x) f(x, names(x)))` or `mapply/Map(f, x, names(x))` | `imap()`, `imap_*()` (`lgl`, `dbl`, `chr`, and etc. just like for `map()`, `map2()`, and `pmap()`) |
76+
| Any | Selected elements of the vector | `l/s/vapply(X[index], FUN, ...)` | `map_if()`, `map_at()` |
77+
| List | Recursively apply to list within list | `rapply()` | `map_depth()` |
78+
| List | List only | `lapply()` | `lmap()`, `lmap_at()`, `lmap_if()` |
7979

8080
### Extractor shorthands
8181

0 commit comments

Comments
 (0)