The purpose of this project is to collect and clean human activity data orginally collected during an experiment for building a system for human physical Activity Recognition (AR) using inertial sensors of a Galaxy S2 smartphone.
A full description of the original experiment can be found in the UCI Machine Learning Repository.
This repository contains the following files:
run_analyis.R
: R script tranforming the original data into a tidy data set according to the peer assessment instructionsCodeBook.md
: Describes the variables, the data, and the transformations that were performed to clean up the original data
You need to install the following R libraries on your machine:
install.packages('plyr')
Download run_analysis.R
from this repository and put it into your R working directory
- Downlad the original project data from this location
- Extract the downloaded archive to your working directory
After a succesful installation your working directory should contain the following files and folders:
Note: Only the first two folder levels below the root level are shown here.
- run_analysis.R
- UCI HAR Dataset
- test
- train
- activity_labels.txt
- features.txt
- features_info.txt
- README.txt
After completing the installation you can execute run_analysis.R
in your R working directory.
run_analyis.R
will access the original data contained underneath the UCI HAR Dataset
folder and do 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 activity names.
- Creates a second, independent tidy data set with the average of each variable for each activity and each subject
- Stores the tidy data set as a .txt file to your working directory