Getting and cleaning data set project assignment
-
if the data folder does not exist, create it
-
if the zip file does not exist, download "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip" it and unzip it.
-
install dplyr package
-
read subject_train.txt and subject_test.txt files into data tables then bind them into a data table called subject with the column named 'subject'.
5.Read y_train.txt and y_test.txt files into data tables then bind them into a data table called activity with the column named 'activity'.
6.Read activity_labels.txt into a data table called activity_labels.
7.Replace numeric values with descriptions of activities
8.Read X_train.txt and X_test.txt files into data tables then bind them into the data table called phone_data.
-
Read the features.txt into a data table called features.
-
Renamed the columns of phone_data in by using the the descriptions of the phone measurements contained in features.
-
Creates a data table that only contains column names that includes 'std' or 'mean', not case sensitive.
12 Bind the data tables subject, activity_list, and reduced_data into the data table called combined_data
-
Renames the column name 'activity_list' to 'activity'
-
creates a data table called tidy_data that is the result of grouping the combined_data table by subject and activity and finding the mean of each activity.
-
writes the table tidy_data to file tidy_data.txt