Skip to content

gerchikov/GCD_Course_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

The following files must be present in the current working directory:

  • ./UCI HAR Dataset/activity_labels.txt
  • ./UCI HAR Dataset/features.txt
  • ./UCI HAR Dataset/test/subject_test.txt
  • ./UCI HAR Dataset/test/X_test.txt
  • ./UCI HAR Dataset/test/y_test.txt
  • ./UCI HAR Dataset/train/subject_train.txt
  • ./UCI HAR Dataset/train/X_train.txt
  • ./UCI HAR Dataset/train/y_train.txt

Run as source("run_analysis.R")

Steps:

  1. Read data files common to both test and train sets:
  • activity_labels.txt
  • features.txt Prepare a logical vector that flags mean and standard deviation values for every variable.
  1. Define a function to read in the test or train dataset. Within it:
  • read subject, X and y files (only the "interesting" columns of X); assign meaningful column names
  • add subject ids and activity ids to X data frame
  • merge (and return) the resulting X data frame with human-readable activity labels
  1. Using defined function, read in test and train sets
  2. Combine the two sets
  3. Summarise the combined set, computing group means of every data column, grouping by activity label and subject id
  4. Write output of step 5 to step5.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages