Skip to content

caldwellsa/gcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting and Cleaning Data Course Project

Source Code: run_analysis.R

Instructions:

  1. Download run_analysis.R into your working directory.
  2. From R console or R Studio run the command: source("run_analysis.R")

Original data source and description: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones

Data source for project: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip

Project objectives:

  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 activity names.
  5. Creates a second, independent tidy data set with the average of each variable for each activity and each subject.

Reference: https://class.coursera.org/getdata-003/human_grading/view/courses/972136/assessments/3/submissions

Program Output:

  • tidydata.csv - Tidy data containing average and standard deviation measurements for each observation.
  • avg_data.csv - Mean values of the observations from tidydata.csv, grouped by subject and activity.

Dependencies: library("stringr")

Program operation:

  1. Create and change to working directory "gcd"
  2. Download and extract data
  3. Read Test dataset
  4. Read Train dataset.
  5. Merge datasets
  6. Label columns
  7. Replace numeric activity labels with descriptive strings.
  8. Select data to keep in final dataset (average and standard deviation values)
  9. Create second dataset with averages grouped by subject and activity.
  10. Save the datasets to disk.

About

Getting and Cleaning Data course project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages