This code converts the Human Activity Recognition Using Smartphones Data Set from the UCI Machine Learning Repository into a single dataset according to the tidy data principles outlined in Wickham, Hadley. "Tidy data."
The script accomplishes this by doing the following:
- Merges the training and the test sets to create one data set.
- Extracts only the measurements on the mean and standard deviation for each measurement.
- Uses descriptive activity names to name the activities in the data set
- Appropriately labels the data set with descriptive variable names.
- From the data set in step 4, creates a second, independent tidy data set with the average of each variable for each activity and each subject.
- Download and extract the data set. Place this script in the same direectory as the extracted data set.
- Change the working directory to the folder contained this script using
setwd
. - Run the script
run_analysis.r
. The script will generate an additional filetidy.txt
according to step 5 above.
This script uses thereshape2
package.