LoslegenKostenlos loslegen

Removing sheets

After presenting the new Excel sheet to your peers, it appears not everybody is a big fan. Why summarize sheets and store the info in Excel if all the information is implicitly available? To hell with it, just remove the entire fourth sheet!

Diese Übung ist Teil des Kurses

Introduction to Importing Data in R

Kurs anzeigen

Anleitung zur Übung

  • Build a connection to "renamed.xlsx", the Excel file that you've built in the previous exercise; it's available in your working directory. Store this connection as my_book.
  • Use removeSheet() to remove the fourth sheet from my_book. The sheet name is "summary". Recall that removeSheet() accepts either the index or the name of the sheet as the second argument.
  • Save the resulting workbook, my_book, to a file "clean.xlsx".

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Build connection to renamed.xlsx: my_book
___

# Remove the fourth sheet
___

# Save workbook to "clean.xlsx"
___
Code bearbeiten und ausführen