This repository contains files for the John Hopkins "Getting and Cleaning Data" Coursera course project.
CodeBook.MD
: code book with details on the datarun_analysis.R
: the analysis R scriptoutput/activity_subject_mean.txt
: generated tidy dataset produced byrun_analysis.R
The data used in this project is from the Human Activity Recognition Using Smartphones Data Set. The data contain experimental measurements for 30 subjects performing six activities while wearing a smart phone that has an accelerometer and gyroscope.
The code book contains information on the variables used in the project, additional details on the data sets, and a description of the data transformation and aggregations.
The run_analysis.R
script contains the R code that is used to download the data sets. The script then merges, cleans, transforms, and summarizes the data sets.
The script also generates a secondary, independent data set that contains the averages for each of the variables by activity for each subject. The generated data set is saved to the output
directory and stored in the same space-delimited txt file as the original data sets.
The steps of the analysis script are listed below:
- Download data sets
- Merge testing and training data sets
- Extract the measurements of the mean and standard deviation for each measurement
- Clean variable names and make them more descriptive
- Convert activity values to factors with descriptive names
- Merge all columns into a single data frame
- Calculate the mean of each measurement, grouped by activity and subject
- Save calculated data set to
output