We should create one R script called run_analysis.R that does the following:
- Merges the training and test sets to create one data set.
- For each measurement extracts only the measurements on the mean and standard deviation.
- Names the activities in the data set with descriptive activity names.
- Labels the data set with descriptive activity names.
- Creates an independant and clean data set in the end with the average of each variable for each activity and each subject.
- Download the data source and put into a folder on your local drive. You'll have a
UCI HAR Datasetfolder. - Put
run_analysis.Rin the parent folder ofUCI HAR Dataset, then set it as your working directory usingsetwd()function in RStudio. - Run
source("run_analysis.R"), then it will generate a new filetidy_data.txtin your working directory.
- There are dependencies on packages
reshape2anddata.table. - The dependencies are automatically installed through the script
run_analysis.R.