###Files Description
There are the following files:
-
UCI - the directory that contains the original data files, with so unused files stripped out.
-
run_analysis.R - the actual R code that is used for cleaning up data and convert into required format. The code does the following:
- Merges the training and the test sets to create one data set.
- Extracts only the measurements on the mean and standard deviation for each measurement.
- Uses descriptive activity names to name the activities in the data set
- Appropriately labels the data set with descriptive variable names.
- From the data set in step 4, creates a second, independent tidy data set with the average of each variable for each activity and each subject.
Each of these points has been added to the script near to the code where they are done.
-
meanBySubjectAndActivity.txt - the file contains the "Tidy" data that is submitted as to the course. CodeBook for the tidy file can be found here
-
Checkout or clone this git repo (following example assume repo is checkout to C:\coursera\getData on a windows box)
-
Assuming R has been installed
-
Open up R and run the following
# setup working directory of R setwd("C:/coursera/getData") # run the script which do the steps according to the course project source("run_analysis.R")
-
Once the command prompt returned the R environment would be populated with the data.
-
To look at the merged data of both test and train set run
View(mergedData)
- To look at the tidy data run
View(meanBySubjectAndActivity)
- The tidy file is also regenerated and saved as C:\coursera\getData\meanBySubjectAndActivity.txt