Git Product home page Git Product logo

gettingdatacourseproject's Introduction

GettingDataCourseProject

This repository host the submission for the course project of the Coursera course: Getting and Cleaning Data

Introduction

The code of run_analysis.R perform the following 5 steps as given in the instruction.

  1. Merges the training and the test sets to create one data set.
  2. Extracts only the measurements on the mean and standard deviation for each measurement.
  3. Uses descriptive activity names to name the activities in the data set
  4. Appropriately labels the data set with descriptive variable names.
  5. Creates a tidy data set with the average of each variable for each activity and each subject.

Detailed steps with variables

Step 1

X_train, y_train, subject_train, X_test, y_test, subject_test contains the data loaded from downloaded txt files.

Then train_test containg the training and testing data are generated using cbind() and rbind()

Step 2

features load the features corresponding to the columns of X_train and X_test files.

mean_and_std_positions use grep to locate the feature names with either mean() or std()

train_test_selected contains the subset of train_test that needs further analysis.

Step 3

activity_labels loads the activity labels and the corresponding activity names. It's merged with train_test_selected by the activity lable to get all_data.

all_data has both the activity labels and the activity names.

Step 4

Modify names(all_data) to label the data set with descriptive variable names.

Step 5

I create tidy_data by using aggregate() function and then save it into tidy_data.txt file

Files

README.md is this README file

CodeBook.md describes the procedures and variables

run_analysis.R is the R code to do the analysis and save a tidy data

UCI HAR Dataset is the folder contained the original data collected. The detailed explanation is here.

tidy_data.txt is the tidy data requred for submission. It's generated by the last step of the run_analysis.R code.

References

The community TA's posts in the forum are quite helpful for me to finish the project:

gettingdatacourseproject's People

Contributors

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