You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Victor, just discovered this, looks like another terrific package from you!
I got a question regarding uploading data from an excel. Is it possible to upload data from multiple sheets at once?
The text was updated successfully, but these errors were encountered:
Alik-V
changed the title
Multiple sheets
Reading data from multiple sheets at once
Apr 5, 2022
Hey Alik, thank you :)
Currently no, you have to select one sheet. What will be your use-case ? Same data-structure in multiple sheets ? Or retrieving a list with sheet's content ?
Hey Victor,
for the current use case the data structure would be identical in each sheet, however, I can envision some use-cases where it would be different.
I think in my ideal world, it would write all sheets into a list of dataframes and allow me to do whatever post-processing I need to do afterwards myself. This is how I do it at the moment anyway, but would love to use it in combination with the pretty modal interface of datamods 👍
On the simplest level, something like this:
upload_sheet_data<-function(datapath) {
# Names of the sheets present in the upload filesheet_names<-readxl::excel_sheets(path=datapath)
# Empty list that will have dataframes appended to itupload_list<-list()
# Loop for each sheetfor (sheetinsheet_names) {
# Read the sheetdata<-readxl::read_xlsx(datapath, sheet=sheet)
# Bind the data from the sheet to the listupload_list[[sheet]] <-data
}
return(upload_list)
}
Hi Victor, just discovered this, looks like another terrific package from you!
I got a question regarding uploading data from an excel. Is it possible to upload data from multiple sheets at once?
The text was updated successfully, but these errors were encountered: