The data for this project can be found here: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
-
Set the wd
Set the wd to the same folder containing the run_analysis.R script.
-
Read in the training and test data
- Reads the train data in
- Binds the train data together (data frame: t)
- Reads the test data in
- Binds the test data together (data frame: v)
- Binds the train and test data together (data frame: alldata)
-
Names the columns using the features.txt file
-
Subsets the alldata data frame to only mean and sd measurements (data frame: allmeansd)
-
Changes the Activity column to a factor and applies the descriptive names to Activity
-
Summarizes the data by aggregating the measurements by Subject + Activity groups (data frame: df)
-
Writes out the data frame df
-
The last line of code is how to read back in the output file into R