I want to import multiple sheets, selected by a common string in the sheet name, from a single .xlsx file and concatenate them into single data frame. For example, if I have an excel file ('data.xlsx') with worksheets named samples1, samples2, samples3, controls1, controls2, controls3. I want to make a list of the worksheet names, such as:
sheet_list <- lapply(excel_sheets('data.xlsx'), read_excel, path = 'data.xlsx')
Then, I want to import all sheets that contain 'samples' in the name and bind them into a data frame called 'samples'. How can I accomplish this efficiently?
openxlsx
package as it provides a lot of handy functions for reading data from Excel, including workbooks table objects, and exporting to Excel as well. – Konrad