One particularly difficult form of messy data to diagnose appears whenever variables are stored both horizontally across the column names and vertically down column values. You will typically encounter this type of dataset, not in a database, but from a summarized report that someone else has already generated.
Tidying when variables are stored in column names and values
Getting ready
In this recipe, variables are identified both vertically and horizontally and reshaped into tidy data with the melt and pivot_table methods.
How to do it...
- Read in the sensors dataset and...