The files are submitted here as a part of getting and cleaning data course. The goal is to prepare tidy data from raw data [1] that can be used for later analysis.
[1] 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
Here are the data for the project:
https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
- README.md - contains information about the files in directory
- Codebook.md - contains information about the variables, the data, and any transformations performed to clean up the data
- run_analysis.R - prepares tidy data useful for analysis from the raw dataset.
- tidydata.txt - tidy data after running the script
- Unzip the data in current working directory
- Current Working directory should contain a folder named "UCI HAR Dataset" which has all required files.
- Run "run_analysis.R" script
- Tidy data is stored in the file "tidydata.txt"
- To read the tidy data,
data <- read.table("tidydata.txt", header = TRUE)
- Reads the training and testing source files from data set,also gives appropriate names to columns. It also reads features.txt to extract feature names.
- Does labelling of feature measurements in training and testing data for ease of use
- Merges the training and the test sets to create one data set.
- Uses descriptive activity names to name the activities in the data set. Activity labels are taken from activity_labels.txt
- Extracts only the measurements on the mean and standard deviation for each measurement.
Here, only measurements of mean() and std() are considered . patterns are given as "-mean()" and "-std() specifically to exclude measurements like meanFreq(). - Modifies labels keeping Google's R style guide into consideration for human readability
- Creates a second, independent tidy data set with the average of each variable. ddply() function is used.
- Writes this new data to "tidydata.txt" file for further use.