Remove a worksheet in Excel using r package xlsx
问题 As the title stated, I would like to delete the second worksheet in excel using r with package xlsx. However, after running the code, nothing happened. Following is a sample code I used to delete the sheet: path = "C://ECOS//Code//Test//data.xlsx" sheets = getSheets(loadWorkbook(path)) removeSheet(loadWorkbook(path), sheetName = names(sheets[2])) Really appreciate helps. Thank you! 回答1: You need to save the workbook in the same file (or different if you prefer). wb = loadWorkbook(path)