Skip to content

Instantly share code, notes, and snippets.

@rayheberer
Created September 29, 2020 21:37
Show Gist options
  • Save rayheberer/ff06f7933242d3849ca1bbd55fc08030 to your computer and use it in GitHub Desktop.
Save rayheberer/ff06f7933242d3849ca1bbd55fc08030 to your computer and use it in GitHub Desktop.
colors <- c("red", "green", "yellow")
vehicles <- c("bicycle", "car", "submarine", "airplane")
colored_vehicles <- colors %>%
purrr::map(function(color) {
purrr::map_chr(vehicles, ~paste(color, .))
}) %>%
purrr::flatten() %>%
unlist()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment