This directory contains the following R scripts:
-- run_analysis.R: This is the main R script to tidy up the data set. It does the following:
- Reads the feature into a data frame. Only those measurements that were a mean or a standard deviation were kept. The names of the variables were made more descriptive.
- Reads "y_test.txt" and "y_train.txt". The activity numbers were changed to descriptive activity names.
- Reads the files containing the measurement data ("X_test.txt" and "X_train.txt") and the subject data (subject_test.txt" and "subject_train.txt") into data frames.
- Adds columns representing the subject and activity data for the traning and test sets to the measurement data using the cbind function.
- Combines the measurements of the training and test sets.
- Creates a data frame containing the mean for each variable for each subject and each activty.
- Writes the data frame created in step 6 to the file "tidyData.csv".
To run successfully, the user must have the reshape2 R library installed. The script calls the following two scripts.
-- extractMeanAndStdev.R: This script performs step 1 listed above.
-- readActivity.R This script performs step 2 listed above.
To run successfully, the directory that contains all the R scripts must have the following files in it as well:
- features.txt
- features_info.txt
- subject_test.txt
- subject_train.txt
- X_test.txt
- y_test.txt
- X_train.txt
- y_train.txt