Renaming sheets
Come to think of it, "data_summary" is not an ideal name. As the summary of these excel sheets is always data-related, you simply want to name the sheet "summary".
The workspace already contains a workbook, my_book, that refers to an Excel file with 4 sheets: the three data sheets, and the "data_summary" sheet.
This exercise is part of the course
Importing Data in R (Part 1)
Exercise instructions
- Use
renameSheet()to rename the fourth sheet to"summary". - Next, call
getSheets()onmy_bookto print out the sheet names. - Finally, make sure to actually save the
my_bookobject to a new Excel file,"renamed.xlsx".
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# my_book is available
# Rename "data_summary" sheet to "summary"
# Print out sheets of my_book
# Save workbook to "renamed.xlsx"