The script run_analysis.R reads the Samsung Galaxy S sensors data, merges test and training datasets, normalizes them by extracting only mean- and standard deviation-related measurements. Then adds information about activities and subject and then calculates means of the measurements for the cleaned data groupped by Activity and Subject.
- Download the Samsung sensors data
- Unzip the downloaded archive in your
directory
. - Change R's working directory to "/UCI HAR Dataset":
setwd("<directory>/UCI HAR Dataset")
. - Execute the script:
source("<path-to-script>/run_analysis.R")
. - The cleaned data will be available in the
cleanNormalized
variable. - You can also dump the data into a text file with a following command:
write.table(cleanNormalized, file="normalized.txt", row.names = FALSE)
Code book is in CodeBook.md
.