Created
September 21, 2017 10:24
-
-
Save jeroenjanssens/f8d2fd1d8768b876352c0f4d92e0cefc 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) | |
library(magrittr) | |
library(stringr) | |
library(readxl) | |
directory <- "bunch/of/excel/files" | |
# Get an overview of all the Excel files and their sheets | |
sheets <- | |
data_frame(file = list.files(directory, full.names = TRUE), | |
sheet = map(file, possibly(excel_sheets, otherwise = NA))) %>% | |
unnest(sheet) %T>% | |
View(title = "Overview") | |
# Read in the first 20 rows of every sheet and display in Data Viewer | |
sheets %>% | |
drop_na() %>% | |
mutate(df = map2(file, sheet, read_excel, n_max = 20)) %$% | |
walk2(df, str_c("[", file, "]", sheet), View) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment