-
The script run_analysis.R , downloads the file https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip and saves in the working directory as wearable.zip and unzips it.
-
The script ignores the raw data files in the directories "UCI HAR Dataset/train/Inertial Signals" and "UCI HAR Dataset/test/Inertial Signals"
-
The script then reads data from featurs.txt and activity_labels.txt
-
Only the features that contain the string -mean() or -std() in the feature name are selected
-
The names of the features are modified to a. Convert the uppercase characters to lowercase b. Remove the characters - ( )
-
The script then reads data from X_train.txt ,y_train.txt ,subject_train.txt . It reads only the columns selected in step 4 from the file X_train
-
The script then reads data from X_test.txt ,y_test.txt ,subject_test.txt . It reads only the columns selected in step 4 from the file X_test
-
The script combines rows from y_train.txt and y_test.txt into "y_all" data frame
-
The script combines rows from subject_train.txt and subject_test.txt into "subject" data frame
-
The script merges y_all and subject data frames into "adt" data frame
-
The script combines rows from x_train.txt and x_test.txt into "x_data" data frame
-
The script then merges data frames "adt" and "activity_labels" into "activity" data frame
-
The script then combines columns from x_data and activity into data frame "all_data"
-
The script removes column activityid from the dataframe "all_data"
-
The script then creates a second, independent tidy data set "data_ave_by_subject_activity" with the average of each variable for each activity and each subject
-
The script then writes the new tidy dataset into file tidydata.txt in to working directory
-
Notifications
You must be signed in to change notification settings - Fork 0
nitinh/Cleaning-Data-using-R
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Coursera Getting and Cleaning Data
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published