Code Monkey home page Code Monkey logo

ds-03-getdata-project's Introduction

Getting and Cleaning Data Course Project

This repository contains the submission for the Getting and Cleaning Data Course Project peer-graded assignment.

R Code

run_analysis.R is a R script with the following functionality.

  1. Download and unzips the data archive if the data directory UCI HAR Dataset is not found
  2. Read the files subject_train.txt, subject_test.txt, X_train.txt, X_test.txt, y_train.txt, y_test.txt using read.table
  3. Merging all data sets into a variable called activity and clearing unused variables
  4. Applying the column names subject and label to first and second column and reading the remaining column names from the file 'features.txt'
  5. Subsetting the data set to only include column that have mean(), std(), subject or label in their names using grepl
  6. Using the factor function to replace the 'label' observations with the activity names from the file from activity_labels.txt
  7. Remove the brackets form the variable names, and lowercase all label observations
  8. Requiring the dplyr package, the script uses the group_by and summarize_at functions to generate a new tidy data set with the average of each variable for each activity and each subject
  9. Writing out the resulting tidy data set into a file called activity_mean.csv and the data set features into a file named activity_mean-features.txt

Codebook

The codebook for the resulting tidy data set in provided in a file named activity_mean-codebook.txt, in the same format and style as the codebook features_info.txt from the original data UCI HAR Dataset set.

ds-03-getdata-project's People

Contributors

haechi 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.