Giter VIP home page Giter VIP logo

r_gettingandcleaningdata's Introduction

Description

This document describes the steps to take to produce a tidy set based on the "Human Activity Recognition Using Smartphones Data Set". See the CodeBook.md file for detailed information on the tidy data set and the raw source data.

Assumptions & Prerequisites

Please note these assumptions when inspecting the tidy dataset and executing the R programming language script that generates the tidy dataset.

  • The R tidying script (run_analysis.R) was developed and tested in this technical environment:
    • R version 3.1.1 (2014-07-10)
    • Mac OS X version 10.9.5
  • The script loads and uses the plyr package. If the plyr package is not installed, the script will generate an error message and stop processing
  • The script creates two directories to store interim working files (tidy_work/...) and final tidy datasets (tidy_output/...)
  • To minimize memory usage, the script executes in steps and writes and reads interim data files. These data files are saved to the working folder (tidy_work/...)
    • NOTE: The script can be run repeatedly. Interim data files will be created if they don't exist and overwritten if they are present. These files can be deleted after the process is complete.
  • Two tidy data sets are produced and saved to the output directory (tidy_output/...)
    • The output datasets are:
      • HumanActivitySmartphonesDataSet_Average_TidyData.txt
      • HumanActivitySmartphonesDataSet_TidyData.txt

Executing the Tidying Script

Use these steps to execute the R script to generate the tidy data set

  1. If not already installed, install the plyr R package into your local R implementation. The plyr package is a prerequisite to execute the tidying script
  2. Clone this repo to your desktop or download the raw data directly from the UCI Machine Learning Repository website. See the CodeBood.md file for more information on accessing the data from the UCI Machine Learning Repository website.
  3. Extract the compressed files contained in getdata-projectfiles-UCI HAR Dataset.zip
  4. Copy or move the tidying script (run_analysis.R) to the folder containing the uncompressed data files (e.g. ...\UCI HAR Dataset)
  5. Open the data folder (...\UCI HAR Dataset) in a terminal emulator (e.g. Terminal on Mac OS, command prompt on Windows)
  6. With the R script (run_analysis.R) in the folder containing the uncompressed data files (...\UCI HAR Dataset), run the R script using the command (Rscript run_analysis.R) using Terminal on Mac OS, the command prompt on Windows or equivalent on your machine
  7. Inspect the script output
  8. Inspect the output files located in: ...\UCI HAR Dataset\tidy_output
  9. View the tidy dataset:
    • ...\UCI HAR Dataset\tidy_output\HumanActivitySmartphonesDataSet_Average_TidyData.txt

r_gettingandcleaningdata's People

Contributors

danoand avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.