To run the run_analysis.R set the correct path into setwd command. The correct path is the path where you are running the script. This path must include the "UCI HAR Dataset" folder containing all the data. "data.table" and "reshape2" packages are required.
The run_analysis script will display the tidy data set in screen and it will create "tidy.csv" file in execution directory.
The script works as indicated below:
1-Read all files from "UCI HAR Dataset"
2-Merges the training and the test sets to create one data set.
3-Extracts only the measurements on the mean and standard deviation for each measurement.
4-Uses descriptive activity names to name the activities in the data set
5-Labels the data set with descriptive variable names.
6-Creates a tidy data set with the average of each variable for each activity and each subject.