Repository for Course Project for Getting and Cleaning Data on Coursera
Follow the following steps to run the code:
- Download the data from this URL and extract it in directory
strPathData
. - Start R or R studio.
- Set the directory where
run_analysis.R
is located as working directory withsetwd(directory of R file)
- Type
source('run_analysis.R')
in R or R studio. - Execute
run_analysis
with the first parameter set to the directorystrPathData
of step 1, by executingrun_analysis(strPathData)
. - Hurra, a tidy data text file that (hopefully) meets the principles of Hadley Wickham's paper "Tidy data" is now in your data directory
strPathData
.
The tidy data file can be read back into R with the command read.table(tidy file,header=TRUE)
.
run_analysis
has 4 optional parameters which you can set.
They refer to the following values:
parameter name | reference |
---|---|
strPathData | path to the data directory |
strPathTest | path to the test folder with regard to strPathData |
strPathTrain | path to the test folder with regard to strPathData |
strNameFileOutStep5 | name of the output file |
For more information of the variables and the method of generating them, read CodeBook.md.