#run_analysis.R
run_analysis.R is the R script which cleans and produces a tidy data set named "tidydata.txt"
The R script uses data downloaded from: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
The original data set and the full description are available at the site where the data was obtained: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
The script follows this basic flow:
- Read the source data
- combine individual data (train + test)
- re-name columns
- remove unwanted columns (we only want those with mean() and std()
- combine all data into one table
- "lengthen" the data by subject and activity using melt (reshape2 library)
- calculate the average using dcast (reshape2 library)
- write the tidy data set
The tidy data set can be read with this R command:
''' d <- read.table("tidydata.txt", header=TRUE)
R, R-Studio, reshape2 library