When running the script, the indicated operations will ocurr:
- Download data if needed
- Produce a tidy dataset, assigning proper variable names, having one table per observational unit
- Transforms the activity numbers into their labels to have more declarative data.
- Creates a second tidy dataset, which contains all variables averaged grouped by activity and subject
- Download the dataset from the source
- Unzips the data into a "data" folder
Solution to requests (1) and (4)
- Loads the variable names dataset
- Loads the test data, binding the subject column and the activity number column. Assigns the variable names read in step 1.
- Loads the train data, binding the subject column and the activity number column. Assigns the variable names read in step 1.
- Binds both test and train datasets into one.
Solution to request (2)
Extracts columns which names matches "mean" or "std", while also keeping subject and activity columns
Solution to request (3)
Replaces label integer column with the correspondent activity names
Solution to request (5)
Average all variables grouped by activity and subject.