Skip to content

Instantly share code, notes, and snippets.

@alistaire47
alistaire47 / 2020-09-22_LA-RUG_Uncomfortable-data.R
Created September 22, 2020 19:00
2020-09-22 LA R Users Group talk: Uncomfortable data
#' Uncomfortable data
#' LA R Users Group
#' 2020-09-22
#' Edward Visel
#' Setup
library(tidyverse)
path <- '/tmp/nycflights13/flights.csv'
@alistaire47
alistaire47 / pMap.R
Created May 2, 2022 05:09
`purrr::pmap()` but with `Map()`-like semantics
pMap <- function(.l, .f, ...) {
.f <- rlang::as_function(.f, ...)
if (rlang::is_named(.l)) {
fun <- function(...) {
rlang::fn_env(.f) <- rlang::env(...)
.f(...)
}
} else {
fun <- .f