Giter Site home page Giter Site logo

getdata-project's Introduction

This readme describes the course project for the 10th iteration of Johns Hopkins University's online course Getting and Cleaning Data. The data for this project can be found [here.] (https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip)

There is only one script, run_analysis.R, which contains all the steps involved from reading the messy data into R to writing the tidied data to a new .txt file.

run_analysis.R assumes that the working directory is the UCI HAR Dataset folder, which contains the "test" and "train" folders as well as activity_labels.txt, features.txt, features_info.txt and README.txt.

run_analysis.R requires the following libraries:

  • plyr
  • dplyr

The script goes through the following steps:

  1. Read features.txt, which gives the variable names for all 561 columns in the training and test sets
  2. Use features.txt to create vectors identifying the columns that measure mean and standard deviation
  3. Read the training set into R
  4. Select only the mean and standard deviation columns from the training set, and rename them
  5. Add a new column to the training set from subject_train.txt, which provides info on which of the 30 subjects corresponds to each observation
  6. Add a new column to the training set from y_train.txt, which provides info on which of the 6 activities corresponds to each observation
  7. Repeat steps 3-6 for the test set
  8. Combine and sort the training and test sets
  9. Make the variable names more descriptive
  10. Replace the numeric values for the activity column with more descriptive names
  11. Create a new dataset with the average of each variable, grouped by each activity and each subject
  12. Write this new dataset to a .txt file

getdata-project's People

Contributors

arnoldlcl avatar

Watchers

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