How the script run_analysis.R works:
- The variable names (in features.txt) are loaded.
- The test data set (in test directory, subject IDs in subjects.txt, activity IDs in y_test.txt, and the remaining observations in X_test.txt) are loaded, assigning the variable names to the appropriate columns.
- Combine subject and activity data with remaining variables.
- Repeat steps 2-3 with training data set (in train directory).
- Combine test and training data into one set.
- Remove all measurement variables except means and standard deviations.
- Make variable names more readable.
- Split data into list where each element contains the data for a single subject.
- Split these elements further into sub-elements that each contain the data for a single activity, resulting in a total of 180 subelements (30 subjects * 6 activities).
- Take the average for each variable in each subelement.
- Convert this list of averages back into a data frame.
- Replace activity IDs with verbal names.
- Write resulting table to a file, tidydata.txt.