Skip to content

Commit

Permalink
not covered
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomUK committed Oct 9, 2023
1 parent f795005 commit b54e78a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions 2023-NHSR-Conf-Presentation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,24 @@ purrr::map(

## Some things we haven't covered

:::{.nonincremental}

* Passing other arguments in
+ eg. the data in the charts example

* The shape of the output
As standard, the map functions return a list containing your result
What if we don't want that. What if we just want a vector back, or a dataframe?
use the suffix functions instead...
map_vec
+ Getting a vector back instead of a list

* map vs. walk
If the important part of your function is it's side-effects, you can use walk instead of map. This doesn't return a list, but a vector of TRUE / FALSE.
* map() vs. walk()
+ Returned values vs. side-effects

* Mapping over more than one variable
+ map2() for 2 variables
+ pmap() and a dataframe of variables for more

* mapping over more than one variable
Sometimes you may need to vary more than one input to the function at a time
with 2 items to very, use map2
With a general number to vary, use pmap
:::

## Further online training
## Further online material

::::: {.columns}

Expand Down

0 comments on commit b54e78a

Please sign in to comment.