The cleaning and getting data script (run_analysis.R) is written to do the following:
- Merge the training and the test sets to create one data set.
- Extract only the measurements on the mean and standard deviation for each measurement.
- Use descriptive activity names to name the activities in the data set
- Appropriately label the data set with descriptive activity names.
- Create a second, independent tidy data set with the average of each variable for each activity and each subject.
To run run_analysis.R
simply change workspace to the folder where this file is. Then run it. There should be no errors and file cleaned_data.txt
should be produced.
- Loads test and train data via subject, x, y sets.
- Changes labels for columns of subject, x, y sets.
- Changes numbers of y (acivityvalue) to activity labels.
- Merges all test data together.
- Merges all train data together.
- Merges test and train data together.
- Retrieves only subject, y, mean and standard deviation columns.
- Mean is calculated for all columns grouped by subjectid and y(activityvalue)
- Result is saved to clean.txt
- codebook - codebook.md
- folder with raw data - data
- readme file - README.md
- result file - clean.txt