Source of the original data: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
Original description: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones
(Copies of the important files have been put into this main directory to fulfill the submission requirement)
Instructions:
-
Unzip the source (https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip) into a folder on your local drive, for example C:\Users\yourname\Documents\R\
-
Put run_analysis.R into C:\Users\yourname\Documents\R\UCI HAR Dataset\
-
In R Console: setwd("C:\Users\yourname\Documents\R\UCI HAR Dataset\"), followed by: source("run_analysis.R")
-
Use data <- read.table("dataset_with_avg_var") to read the data.
The attached R script (run_analysis.R) performs the following clean up and new data set:
-
Merges the training and test sets (train/X_train.txt and test/X_test.txt) and create one data set, i.e cleaned_merge_data.txt
-
Reads features.txt and extracts only the measurements on the mean and standard deviation for each measurement
-
Reads activity_labels.txt and applies descriptive activity names to name the activities in the data set
-
The script also appropriately labels the data set with descriptive names
-
Lastly, the script creates a 2nd, independent tidy data set with the average of each measurement for each activity and each subject