INTRODUCTION
This repository contains scripts to merge and clean data as part of the Coursera "Getting and Cleaning data" course project. The data represent measures collected from the accelerometers from the Samsung Galaxy S smartphone.
INSTRUCTIONS
Steps
- Clone the present repository git clone https://github.com/abmoul/Course-Project
- Change the working directory cd courseproject
- Download the data file
- Unzip the data file unzip getdata-projectfiles-UCI\ HAR\ Dataset.zip
- Run Run_Analysis.R
OUTPUTS
run_analysis.R returns two csv format datasets:
- tidy_dataset.txt: Contains mean and standard deviation for each observation reakted to the training and the testing data;
- tidy_dataset2.txt: Contains tidy data set with the average of each variable for each activity and each subject present in the input.
DESCRIPTION Run_Analysis.R tests if the input zip file ("UCI HAR Dataset.zip") is present in the current working directory, and if no downloads it using the data source location. The script tries first to download the zip file using the download.file() function, and if it fails uses the 'wget' method. The script downloads the datasets for the measurements, activities and subjects, merges the data frames and filters the data for the means and standard deviations variables to create the first tidy dataset (tidy_dataset.txt). Averages for each activity and each subject are then extracted creating the second tidy dataset (tidy_dataset22.txt).
The codebook describing the dataset can be found in the present repository.