Skip to content

regulous/Getting-and-Cleaning-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

##Getting-and-Cleaning-Data

After loading the dataset according to the instruction of Peer Assignment description on Course Getting and Cleaning Data, run this script, this program cleans the dataset by doing the following:

1.Reads-in the feature.txt file (which contains the names of the variables) and stores it as feature
2.Selects the names in feature which are either a mean or a standard deviation and stores their positions in colneeded
3.Using the colneeded vector, run_analysis.R creates a vector comprised of "NULL"s and "numeric"s based on which columns we will want to ignore or read-in respectively
4.Stores the data we want from the test data using the read.table function and the colClasses specification
5.Adds a row for both the test subject number and the activity they performed
6.Repeats steps 4 & 5 for the training data and then combines the two data frames into comdf
7.Renames the columns of comdf for clarity and orders the data frame by subject and then activity
8.Replaces the numbers representing each activity with the name of each activity for added clarity
9.Condenses the data by averaging variables which share a subject and activity (e.g. If there were originally 10 reported tBodyAcc-mean()-X values for the 19th subject while walking downstairs, those 10 rows would be condensed into 1 row with the mean of the 10 reported)
10.Finally run_analysis.R writes the condensed and tidy data to a .csv file

About

PeerAssignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages