This repo explains how all of the scripts work and how they are connected. In this project only one script is needed and its name has to be run_analysis.R
The run_analysis.R script does the following:
- 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.
This script doesn't depend on any other script, but needs the following libraries to work:
- reshape2
- data.table
Follow these steps to be able to replicate the project:
- Download the data from https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip and unzip it. It will create a folder called
UCI HAR Dataset. - The folder
UCI HAR Datasetand the scriptrun_analysis.Rmust be on the same folder level (script and folder on the same parent directory). - Set the parent directory as the working directory using the setwd() function.
- Run
source("run_analysis.R"). It will generate a new filetiny_data.txtin the working directory.