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
| snippet view | |
| View(.Last.value) | |
| snippet snap_df | |
| if (!is.data.frame(.Last.value)) { | |
| warning("Last value is not a data.frame") | |
| } else { | |
| assign(".Last.df", .Last.value, pos = .GlobalEnv) | |
| message("Assigned last created data.frame to `.Last.df`") | |
| invisible() |
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(magrittr) | |
| library(readxl) | |
| folder <- "./Folder full of folders full of xls or xlsx files/" | |
| # Store all data in one list of lists (ie one list of workbooks, each | |
| # workbook is a list of sheets, each sheet is a dataframe (or an error message if applicable)) | |
| data_ <- | |
| # List all xls(x) files in folder (recursively) | |
| list.files(path = folder, pattern = "xlsx?$", full.names = TRUE, | |
| recursive = TRUE, ignore.case = TRUE) %>% |