The script run_analysis.R tidies the data collected from the experiment Human Activity Recognition Using Smartphones Dataset Version 1.0 conducted by Smartlab - Non Linear Complex Systems Laboratory [1]. The data from this experiment is available for download from https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip.
The run_analysis.R script performs the following steps:
- Download the experiment data from the source URL above.
- Extract the download file into the /data subdirectory of the project. It creates the /data subdirectory if it does not exist.
- Load the FIELD/FEATURE names from /data/UCI HAR Dataset/features.txt.
- Load the TRAINING data from /data/UCI HAR Dataset/train folder using the previously FIELD names.
- Load the TEST data from /data/UCI HAR Dataset/test folder using the previously loaded FIELD names.
- Merge the TRAINING and TEST data into a single data set.
- In the merged data set, extract only the measurements for mean and standard deviation for each measurement.
- Clean up the column names to be more readable in the extracted data set.
- Transform the ACTIVITY field to use descriptive names as defined in /data/UCI HAR Dataset/activity_labels.txt.
- Save the tidy dataset to /data/analysis/HAR Dataset - Tidy.csv
- Create a second tidy dataset with the average of each variable for ech activity and each subject and save it to /data/analysis/HAR Dataset - Summarized by Activity and Subject.csv
- Save the dataset column names in /data/analysis/HAR Dataset - Column Names.txt
- RStudio v1.1.463 - Windows
- R version 3.5.2 (2018-12-20)
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- Running under: Windows >= 8 x64 (build 9200)
- dplyr v0.7.8
[1] Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra and Jorge L. Reyes-Ortiz. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. International Workshop of Ambient Assisted Living (IWAAL 2012). Vitoria-Gasteiz, Spain. Dec 2012