powered by
Remove a sheet from an xlsx workbook, deleting the worksheet XML, its relationship file and the content-type override.
sheet_remove(x, sheet)
the rxlsx object (invisibly)
rxlsx object
name of the sheet to remove
wb <- read_xlsx() wb <- add_sheet(wb, "kept") default_name <- sheet_names(wb)[1] wb <- sheet_remove(wb, sheet = default_name) print(wb, target = tempfile(fileext = ".xlsx"))
Run the code above in your browser using DataLab