Last active
March 6, 2019 16:18
-
-
Save ColinFay/d74d331825868b181860212cd1577b69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
files <- list.files("../open-data/", pattern = "^2017", full.names = TRUE) | |
full <- map_df(files, read_csv) | |
dplyr::glimpse(full) | |
# With names | |
files <- list.files("../open-data/", pattern = "^2017", full.names = TRUE) %>% | |
set_names(basename(.)) | |
full <- map_df(files, read_csv, .id = "file") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this post: https://twitter.com/_colinfay/status/949023275534946304?lang=en
I watched https://www.rstudio.com/resources/webinars/whats-new-with-readxl/ but didn't know how to pass the filename as the .id
This was showing the sheet but felt short of telling how to pass the name.
Thanks for the quick script above