I have an excel workbook that has multiple sheets in it that correspond to an individual subject. All the columns in each of the sheets are formatted with the same headers and all the data in numerical text. I was able to import all the sheets together into a master sheet that combined all the rows together under the same columns with the following code:
test <- data %>% excel_sheets() %>% map_df(read_excel, path=data)
Any ideas on how I could have it so that for each sheet imported, a column is added that includes the name of the sheet.
Example: I have a workbook with sheets a, b, and c that each have columns data 1, data2, data3, can I import and combine them into 1 data frame that now have a column 4 which corresponds to the sheet name, a, b, or c?
data
are (in this case I'm guessing it is a file path). That will help folks help you. :) You can see some good info on how to make a reproducible example at this link. See similar, R-specific info here. – aosmith