concept Excel file in category R

This is an excerpt from Manning's book Exploring Data with R MEAP V05.
Figure 5.4 The us_cities sheet in the example Excel file is a paragon of clean data as an input for the read_excel() function. This will make your life easier.
![]()
The second sheet (called us_cities_messy) contains the us_cities data, however, there is additional data strewn about in different cells. We can look to the first sheet as the idealized example of data stored in an Excel file. It won’t provide us with any data import problems, and it’s something to strive for when managing data in Excel files. The second is a more real-world example of an Excel sheet you’ll often encounter. Perhaps a colleague provided this file as a source of data for a project, perhaps it’s your own file, it really doesn’t matter. What does matter is that the data must be cleaned/reorganized before importing it into R.
Ensuring that we are within an RStudio Project, let’s use create_excel_file() to generate the example Excel file (Listing 5.5).
Listing 5.5. Using the create_excel_file() function to write us_cities.xlsx to the project directory.
create_excel_file()This function doesn’t require any options. It will just write the Excel file that’s stored in the edr package to the working directory. You’ll get a helpful message in the console that describes what happened: