Giter Site home page Giter Site logo

cleaningdata1's Introduction

Using run_analysis.R

Use the following command to clean up the data.

R CMD BATCH run_analysis.R

The script first collects the activity and feature labels.

Then it filters the features labels list to select only the mean/std features.

It will go into each directory for test and train, collect the data readings and combine it for each subject.

It will merge the combined data with the activity labels.

Finally, it will aggregate based on both Subject and Activity using the mean function.

I dropped the Y.test and col.names that got generated during data cleaning since they're meaningless values.

Code Book

The following code book describes the variables:

Variable Explanation
Subject The test subject in question
Activity The tested activity the measurement is on
X.test.tBodyAcc.mean...X average of the mean of the raw body acceleration reading on the x axis
X.test.tBodyAcc.mean...Y average of the mean of the raw body acceleration reading on the y axis
X.test.tBodyAcc.mean...Z average of the mean of the raw body acceleration reading on the z axis
X.test.tBodyAcc.std...X average of the mean of the standard deviation of the the raw body acceleration reading on the x axis
X.test.tBodyAcc.std...Y average of the mean of the standard deviation of the the raw body acceleration reading on the y axis
X.test.tBodyAcc.std...Z average of the mean of the standard deviation of the the raw body acceleration reading on the z axis
X.test.tGravityAcc.mean...X average of the mean of the gravity acceleration on the X axis
X.test.tGravityAcc.mean...Y average of the mean of the gravity acceleration on the Y axis
X.test.tGravityAcc.mean...Z average of the mean of the gravity acceleration on the Z axis
X.test.tGravityAcc.std...X average of the standard deviation of the gravity acceleration on the X axis
X.test.tGravityAcc.std...Y average of the standard deviation of the gravity acceleration on the Y axis
X.test.tGravityAcc.std...Z average of the standard deviation of the gravity acceleration on the Z axis
X.test.tBodyAccJerk.mean...X average of the mean of the jerk acceleration of the body on the X axis
X.test.tBodyAccJerk.mean...Y average of the mean of the jerk acceleration of the body on the Y axis
X.test.tBodyAccJerk.mean...Z average of the mean of the jerk acceleration of the body on the Z axis
X.test.tBodyAccJerk.std...X average of the standard deviation of the jerk acceleration of the body on the X axis
X.test.tBodyAccJerk.std...Y average of the standard deviation of the jerk acceleration of the body on the Y axis
X.test.tBodyAccJerk.std...Z average of the standard deviation of the jerk acceleration of the body on the Z axis
X.test.tBodyGyro.mean...X average of the mean of the gyro of the body on the X axis
X.test.tBodyGyro.mean...Y average of the mean of the gyro of the body on the Y axis
X.test.tBodyGyro.mean...Z average of the mean of the gyro of the body on the Z axis
X.test.tBodyGyro.std...X average of the standard deviation of the gyro of the body on the X axis
X.test.tBodyGyro.std...Y average of the standard deviation of the gyro of the body on the Y axis
X.test.tBodyGyro.std...Z average of the standard deviation of the gyro of the body on the Z axis
X.test.tBodyGyroJerk.mean...X average of the mean of the gyro jerk of the body on the X axis
X.test.tBodyGyroJerk.mean...Y average of the mean of the gyro jerk of the body on the Y axis
X.test.tBodyGyroJerk.mean...Z average of the mean of the gyro jerk of the body on the Z axis
X.test.tBodyGyroJerk.mean...X average of the mean of the gyro jerk of the body on the X axis
X.test.tBodyGyroJerk.mean...Y average of the mean of the gyro jerk of the body on the Y axis
X.test.tBodyGyroJerk.mean...Z average of the mean of the gyro jerk of the body on the Z axis
X.test.tBodyAccMag.mean.. average of the mean of the magnitude of the acceleration of the body
X.test.tBodyAccMag.std.. average of the standard deviation of the magnitude of the acceleration of the body
X.test.tGravityAccMag.mean.. average of the mean of the magnitude of the gravity acceleration
X.test.tGravityAccMag.std.. average of the standard deviation of the magnitude of the gravity acceleration
X.test.tBodyAccJerkMag.mean.. average of the mean of the magnitude of the gravity jerk acceleration of the body
X.test.tBodyAccJerkMag.std.. average of the standard deviation of the magnitude of the gravity jerk acceleration of the body
X.test.tBodyGyroMag.mean.. average of the mean of the magnitude of the body gyro
X.test.tBodyGyroMag.std.. average of the standard deviation of the magnitude of the body gyro
X.test.tBodyGyroJerkMag.mean.. average of the mean of the magnitude of the body gyro jerk
X.test.tBodyGyroJerkMag.std.. average of the standard deviation of the magnitude of the body gyro jerk
X.test.fBodyAcc.mean...X average of the mean of the fft of the body acceleration on the X axis
X.test.fBodyAcc.mean...Y average of the mean of the fft of the body acceleration on the Y axis
X.test.fBodyAcc.mean...Z average of the mean of the fft of the body acceleration on the Z axis
X.test.fBodyAcc.std...X average of the standard deviation of the fft of the body acceleration on the X axis
X.test.fBodyAcc.std...Y average of the standard deviation of the fft of the body acceleration on the Y axis
X.test.fBodyAcc.std...Z average of the standard deviation of the fft of the body acceleration on the Z axis
X.test.fBodyAccJerk.mean...X average of the mean of the fft of the body acceleration jerk on the X axis
X.test.fBodyAccJerk.mean...Y average of the mean of the fft of the body acceleration jerk on the Y axis
X.test.fBodyAccJerk.mean...Z average of the mean of the fft of the body acceleration jerk on the Z axis
X.test.fBodyAccJerk.std...X average of the standard deviation of the fft of the body acceleration jerk on the X axis
X.test.fBodyAccJerk.std...Y average of the standard deviation of the fft of the body acceleration jerk on the Y axis
X.test.fBodyAccJerk.std...Z average of the standard deviation of the fft of the body acceleration jerk on the Z axis
X.test.fBodyGyro.mean...X average of the mean of the fft of the body gyro on the X axis
X.test.fBodyGyro.mean...Y average of the mean of the fft of the body gyro on the Y axis
X.test.fBodyGyro.mean...Z average of the mean of the fft of the body gyro on the Z axis
X.test.fBodyGyro.mean...X average of the standard deviation of the fft of the body gyro on the X axis
X.test.fBodyGyro.mean...Y average of the standard deviation of the fft of the body gyro on the Y axis
X.test.fBodyGyro.mean...Z average of the standard deviation of the fft of the body gyro on the Z axis
X.test.fBodyAccMag.mean.. average of the mean of the fft of the body acceleration
X.test.fBodyAccMag.std.. average of the standard deviation of the fft of the body acceleration
X.test.fBodyBodyAccJerkMag.mean.. average of the mean of the fft of the body acceleration jerk magnitude
X.test.fBodyBodyAccJerkMag.std.. standard deviation of the mean of the fft of the body acceleration jerk magnitude
X.test.fBodyBodyGyroMag.mean.. average of the mean of the fft of the body gyro magnitude
X.test.fBodyBodyGyroMag.std.. average of the standard deviation of the fft of the body gyro magnitude
X.test.fBodyBodyGyroJerkMag.mean.. average of the mean of the fft of the body gyro jerk magnitude
X.test.fBodyBodyGyroJerkMag.std.. average of the standard deviation of the fft of the body gyro jerk magnitude

cleaningdata1's People

Contributors

yiuminghuynh avatar

Watchers

Yiu Ming Huynh 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.