After you download and unzip the database, before to use the "run_analysis.R" script you need follow this steps:
- load the packages "dplyr" and "reshape2" (use "install.packages()" & "library()" functions)
- define your work directory like "./UCI HAR Dataset"
Then, the "run_analysis.R" script works this way:
Read the data and load it in R from useful .txt files (train, test, features, activity)
Merge the train, test, features and activity data to obtain one dataframe which contains all the data
Select only the data of the variables with "Mean" and "Std" words in their names
First group_by the data in order the useful variables (Subject and Activity) to then calculate the mean of each other variables
Assign the respective Activity in order to Label Index Change same parts of column names replacing for others ("." to ""; "BodyBody" to "Body"; etc)
Export the tidy data to .txt file