This program perform the following functions:
- Merges the training and the test data set to create one data set.
- Extracts only the measuremetns on the mean and standard deviation from the merged data set.
- Group the data set by activities then subjects.
- Calculate the average values for each variable for each activity and subject.
This script assigns the original data column name from the features.txt file, uses the regular expression to select the columns that have mean() and std() in the names. It also uses the sapply function and activity index and label list to convert the activity index in the data set to the activity label. Last, it uses the pipe %>% functions to group the data set by activity and subject, then summarize and mean functions to get the average for each group.