GithubHelp home page GithubHelp logo

courseraproject1's Introduction

CourseraProject1

Project for "Getting and Cleaning Data" Coursera course.

Script Description

The R script run_analysis.R combines the "test" and "train" data sets and creates a tidy data summarizing the values they contain.

  1. First, the script loads the "features.txt" file that contains the labels for the 500+ measurements contained in each line of the data files.

  2. Next, the script reads the test and train raw data files, and selects only those columns corresponding to mean or standard deviation measurements.

  3. Then, the script reads the activity type numbers (each taking on a value from 1-6) for each row of the tables constructed in step 2. These numbers are then replaced by the descriptive labels found in "activity_labels.txt"

  4. Similarly to step 3, the Subject ID numbers are read and merged into a single vector.

  5. This step merges all of the data together: the test/train data are merged, and two new columns are added, one for the activity and one for the subject ID.

  6. Next, the melt and dcast commands are used to reformat and summarize the data. There are 30 subject ID's and 6 activities, so each of the two data sets (one for mean, one for standard deviation) has 180 rows.

  7. Finally, these tidy data sets are written to two separate files.

courseraproject1's People

Watchers

James Cloos avatar James Hamblin 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.