This repository contains code to clean up data from UCI Human Activity Recognition Using Smartphones Data Set:.
Running the R script run_analysis.R
will:
- Combine the test and train data
- Prune the data to only contain mean and standard deviation
- Attach clean headers
- Add columns for activity and subject
- Calculate a second (summary) data set that averages the data by activity and subject
- Save the resulting data using default
write.table
settings (space as separator etc.) so it can be read withread.table
without specific settings.
Final data is stored in variables data
and summary
, and written to files clean_UCI_data.txt
and clean_UCI_summary.txt
. The details of the data are in WorkBook.md
. The file features_info.txt
contains the original description of the measurements and is only added for completeness.
The following files are expected to be readable for run_analysis.R
:
train/X_train.txt
train/y_train.txt
train/subject_train.txt
test/X_test.txt
test/y_test.txt
test/subject_test.txt
activity_labels.txt
features.txt