Skip to content
This repository was archived by the owner on Jun 12, 2020. It is now read-only.

Latest commit

 

History

History
28 lines (24 loc) · 1.77 KB

File metadata and controls

28 lines (24 loc) · 1.77 KB

CodeBook

Introduction

This codebook describes the Variables, data and transformatiosn that are used in "run_analysis.r" R-Script.

Data & Variables

  • train: contains the training data "X_train.txt" with the extra columns: "y_train.txt" and subject_train.txt.
  • test: contains the test data "X_test.txt" with the extra columns: "y_test.txt" and subject_test.txt.
  • ttdata: the training data "train" unioned with the test data "test". This set is reused when selecting only the necessary features.
  • names(): fives the names to the columns of the table/ data.frame.
  • features: the features from the "features.txt" file.
  • selectedfeatures: the features that contain "mean()" or "std()".
  • activities: the labels of the activities.
  • result: the final result of the "run_analysis.R" script, aggregates the ttdate with the "aggregate" function on the two columns "activity" and "subject" and applies the function mean to the other columns.

Transformations

The "run_analysis.R" script is devided into 5 (+1 additional) parts.

  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 variable names.
  5. From the data set in step 4, creates a second, independent tidy data set with the average of each variable for each activity and each subject.
  6. Writes the output to file named "run_analysis.txt"