Here are the files for my project in the Getting and Cleaning Data course. This does not include the large data files X_test.txt, y_test.txt, X_train.txt, and y_train.txt. At least one of these was too large for Github. The run_analysis.R script will work fine if you run it in the same directory as these files on your local machine.
Steps to run the script:
- create a directory with all the files needed to run the script (see below)
- download the run_analysis.R script into the directory you created
- install the packages into R listed below, if not already installed
- run the script in R or RStudio
The files needed to run the script are:
- activitiy_labels.txt
- features.txt
- X_test.txt
- y_test.txt
- subject_test.txt
- X_train.txt
- y_train.txt
- subject_train.txt
The dependancies for the script are:
- dplyr
- stringr
- reshape2
The script will perform the following general tasks:
- Load all the data sets into data frames
- Add the activity labels the train and test data frames
- Add the subject numbers to the data frames
- Combine the test and train data
- Add the variable names
- Select out the variables of interest (containing "mean" or "std")
- Edit the variable names to clean them up
- Reshape the data into a new data frame that is tidy, presenting the means for each measurement, grouped by subject and activity