Download data from link provided and unzip it to R working directory.
dplyr and tidyr to make your life easy.
The "analysis.R" file executes the five steps stated in the problem. These are: 1. Merging the training and the test sets to create one data set. Reading files Assigning names to columns Merging all data in one set Extracting only the measurements on the mean and standard deviation for each measurement Reading column names Create vector for defining names, mean and standard deviation Subsetting for all merged data Using descriptive activity names to name the activities in the data set Appropriately labeling the data set with descriptive variable names Making second tidy data set Writing second tidy data set in txt file
trainX, trainy, testX, testy, trainD and testD are the given data which subsequently converted into the dplyr dataframe using the tbl_df function. These generated a new set of data variables as presented in the code. The data were the merge together to produce a single data frame for analysis.