Skip to content

TradeUpCards/gettingandcleaningdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gettingandcleaningdata

Coursera Getting And Cleaning Data Course

Course Project

Data

The data for this project can be found here: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones

run_analysis.R

Process

  1. Set the wd

    Set the wd to the same folder containing the run_analysis.R script.

  2. Read in the training and test data

    • Reads the train data in
    • Binds the train data together (data frame: t)
    • Reads the test data in
    • Binds the test data together (data frame: v)
    • Binds the train and test data together (data frame: alldata)
  3. Names the columns using the features.txt file

  4. Subsets the alldata data frame to only mean and sd measurements (data frame: allmeansd)

  5. Changes the Activity column to a factor and applies the descriptive names to Activity

  6. Summarizes the data by aggregating the measurements by Subject + Activity groups (data frame: df)

  7. Writes out the data frame df

  8. The last line of code is how to read back in the output file into R

About

Coursera Getting And Cleaning Data course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages