Project for Getting and Cleaning Data Coursera Course
This project creates one R script, run_analysis.R, which performs the following tasks:
- 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.
Once executed, the resulting dataset is produced as MeanCombinedData.txt.
To accomplish these steps, run_analysis.R must do the following:
- Install required packages, "data.table" and "reshape2".
- Load subject datasets.
- Merge subject datasets and assign a column name, "SUBJECTS".
- Load X values datasets.
- Merge X values datasets.
- Load Y values datasets.
- Merge Y values datasets.
- Load features data.
- Apply feature names to X values.
- Load activity labels and apply to Y values
- Subset X by mean and std.
- Combine datasets.
- Write data as .txt file ("CombinedData.txt").
- Calciulate mean of variables by subject.
- Write new data as .txt file (MeanCombinedData.txt").
Each of these steps is commented within the run_analysis.R code.