Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

ReadMe

This repository contains source and supporting files for the Getting and Cleaning Data course (5 May 2014 session) by Jeff Leek. The course can be found at https://class.coursera.org/getdata-003.

Assignment

  1. Merge the training and the test sets to create one data set.
  2. Extract only the measurements on the mean and standard deviation for each measurement.
  3. Use descriptive activity names to name the activities in the data set
  4. Appropriately labels the data set with descriptive activity names.
  5. Create a second, independent tidy data set with the average of each variable for each activity and each subject.

Steps three and four above have been interpreted as follows per forum thread https://class.coursera.org/getdata-003/forum/thread?thread_id=55

  1. Replace row entries with activity names (as provided in the data)
  2. Replace column labels with more easily understood versions (as determined by us)

Contents

  1. README.md - This file.
  2. CodeBook.md - CodeBook describing transformation and output data
  3. run_analysis.R - Analysis and transformation script.

Assumptions

Completion Criteria

The completion criteria as provided by community TA David Hood in the Forum thread https://class.coursera.org/getdata-003/forum/thread?thread_id=92 is as follows:

  • The explanation is as important as the script, so make sure you have the read me
  • have you combined the training and test x and y into one block, given them headings, and turned the numeric activities into something easier to read. Think of it as you data files are blocks of lego and you are working out how to clip them together to make a wall.
  • have you extracted some variables to do with mean and standard deviation from the full set. I am being non-specific here because in this assignment you are using you professional judgement about which variables to include and documenting your reasoning. There is no specific number of columns that is correct.
  • have you explained what those variables are and your criteria for picking them in the readMe
  • have you gotten the average of each variable for each combination of subject and activity and saved the data frame of this as a set of tidy data
  • have you give the variables English-like descriptive names describing the activity that the sensor is measuring? (this is a slightly, or indeed very, horribly worded part of the assignment)
  • remember that codebook you had to learn to use in the week 1 quiz, now it * is time to create your own describing those descriptive English named variables you decided to use. The codebook should go on github to. have you loaded up your current script, an up to date read me and the codebook to github?
  • and your tidy data to coursera- Important load in a text file of the data (or at least some kind of file). Do not try and copy and paste in all your tidy data. Very, very bad things might happen to your submission. Do not experiment to find out what, just trust me on this from previous experience. Add a file like it says in the instructions. Personally, I think it is a reasonable assumption to figure that anyone doing this course is able to deal with a tab delimited text file like you get by taking your data and doing write.table().

Source Data

The source data can be found at: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip

Source Data Working Directory

The source data directory is stored in the working directory as "UCI HAR Dataset".

  • If the data directory "UCI HAR Dataset" is present in the working directory, it will assume the uncompressed source data is present in that directory.
  • If the data directory is missing, it will look for the compressed source file "UCI HAR Dataset.zip" and create the data directory in the working directory from the compressed source file.
  • In the event both are missing, the program will attempt to download the compressed source file and uncompress it to create the data directory.

Output Data Working Directory

The tidy data set will be stored in the "Output Dataset" directory.

  • If the output directory does not exist, the program will create it in the current working directory.

Transformations

The source code loads the test and training data sets, reduces them to the "interesting" measurements (those containing means or standard deviations for the time or frequencie domains, as well as mean frequencies for the frequency domain). The activities (using descriptive names from activity_labels.txt) and Subject identifiers are appended.

The test and training data sets are joined to create a combination data set containing the columns described above.

An output data set is created from the combination data set with the mean column values for each of the subject/activity combinations.

More descriptive / human readable column names are appplied (see codebook).

The output is written to the "Output Dataset" directory with the filename of "UCI HAR Means TidyData.csv

Style Guide

Naming conventions are per https://google-styleguide.googlecode.com/svn/trunk/Rguide.xml.

License

License: Use of this dataset in publications must be acknowledged by referencing the following publication [1]

[1] Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra and Jorge L. Reyes-Ortiz. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. International Workshop of Ambient Assisted Living (IWAAL 2012). Vitoria-Gasteiz, Spain. Dec 2012

This dataset is distributed AS-IS and no responsibility implied or explicit can be addressed to the authors or their institutions for its use or misuse. Any commercial use is prohibited.

Jorge L. Reyes-Ortiz, Alessandro Ghio, Luca Oneto, Davide Anguita. November 2012.

About

Getting and Cleaning Data Assignment

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages