This repo contains the final project implementation for Coursera's Getting and Cleaning Data course.
The run_analysis.R
file does 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.
To produce tidy data, I'm depending on Wickham's expression of Codd's 3rd Normal Form, as follows:
- Each variable forms a column.
- Each observation forms a row.
- Each type of observational unit forms a table.
In particular, I'm looking for the five most common problems:
- Column headers are values, not variable names.
- Multiple variables are stored in one column.
- Variables are stored in both rows and columns.
- Multiple types of observational units are stored in the same table.
- A single observational unit is stored in multiple tables.
In these data, there are two sets (test and train), which have been disassembled
into three .txt
files each. In the test
set, we have:
subject_test.txt
- identifies the subject who performed the activity for each window sample. Its range is from 1 to 30test_X.txt
- test settest_y.txt
- test labels
In the train
set, we have:
subject_train.txt
- identifies the subject who performed the activity for each window sample. Its range is from 1 to 30train_X.txt
- training settrain_y.txt
- training labels
The code book for this assignment can be found at the root of this repository,
as CodeBook.md
. link
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