Forked from jeroenjanssens/inspect_all_the_excel_sheets.R
Created
September 21, 2017 10:39
-
-
Save IronistM/394a15a6536836604e54f783f962d48a to your computer and use it in GitHub Desktop.
This file contains hidden or 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