This codebook explains the following aspects of both the allData dataset and the avgSubjectActivityData dataset:
- creation: how is it it created
- structure: what is the structure of the dataset
- meaning: what do the data mean
Both datasets are generated by the R-script 'run_analysis.R' found in the
repository. The script writes each dataset to a txt-file with the same name.
These files are included in the repository.
The origin from which the datasets are generated, is downloaded from http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones.
It is provided in the repository in the directory 'UCI HAR Dataset' for your
convenience.
If you wish you can download the data directly by following this link:
https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip
The data represent data collected from the accelerometers from the Samsung
Galaxy S smartphone during several activities performed by a number of subjects.
After unpacking the downloaded zip-file you can run the script run_analysis.
To create the dataset allData the script takes the following steps:
- read the testdata and traindata and merge these into one dataset
- add meaningful column names to the dataset
- extract data on the mean and standard deviation
- label each row with the activity
The resulting dataset is tidy. Each row specifies the mean and standard deviation measurements of an activity performed by a subject.
After these steps the second dataset avgSubjectActivityData is created by the run_analysis script based on the dataset allData:
- read the subject testset and the subject trainset and merge these into one subject dataset
- create a new dataset by adding the subject dataset as a column before the allData dataset
- from the resulting dataset create a new dataset that contains the average of the measurements for each activity of a subject
- give the columns meaningful names
- reorder by subject and activity
This second dataset contains the average of all the measurements contained in the allData dataset grouped by subject and activity. The script writes this dataset to a txt-file named 'avgSubjectActivityData.txt'. This file is also included in the repository.
The allData dataset contains 10299 rows and 67 columns.
Each row represents measurements on 66 different aspects of an activity (which
is specified by the first column) performed by a subject.
The table below shows the variables, their class, range and description.
| Variables | Class | Range | Description |
|---|---|---|---|
| Activity | character | LAYING, SITTING, STANDING, WALKING, WALKING_UPSTAIRS, WALKING_DOWNSTAIRS | Description of the activity. |
| tBodyAcc-mean()-X | numeric | [-1, 1] | Time domain signal, mean for the body acceleration on the X axis. |
| tBodyAcc-mean()-Y | numeric | [-1, 1] | Time domain signal, mean for the body acceleration on the Y axis. |
| tBodyAcc-mean()-Z | numeric | [-1, 1] | Time domain signal, mean for the body acceleration on the Z axis. |
| tBodyAcc-std()-X | numeric | [-1, 1] | Time domain signal, standard deviation for the body acceleration on the X axis. |
| tBodyAcc-std()-Y | numeric | [-1, 1] | Time domain signal, standard deviation for the body acceleration on the Y axis. |
| tBodyAcc-std()-Z | numeric | [-1, 1] | Time domain signal, standard deviation for the body acceleration on the Z axis. |
| tGravityAcc-mean()-X | numeric | [-1, 1] | Time domain signal, mean for the gravity acceleration on the X axis. |
| tGravityAcc-mean()-Y | numeric | [-1, 1] | Time domain signal, mean for the gravity acceleration on the Y axis. |
| tGravityAcc-mean()-Z | numeric | [-1, 1] | Time domain signal, mean for the gravity acceleration on the Z axis. |
| tGravityAcc-std()-X | numeric | [-1, 1] | Time domain signal, standard deviation for the gravity acceleration on the X axis. |
| tGravityAcc-std()-Y | numeric | [-1, 1] | Time domain signal, standard deviation for the gravity acceleration on the Y axis. |
| tGravityAcc-std()-Z | numeric | [-1, 1] | Time domain signal, standard deviation for the gravity acceleration on the Z axis. |
| tBodyAccJerk-mean()-X | numeric | [-1, 1] | Time domain signal, mean for the jerk of the body acceleration on the X axis. |
| tBodyAccJerk-mean()-Y | numeric | [-1, 1] | Time domain signal, mean for the jerk of the body acceleration on the Y axis. |
| tBodyAccJerk-mean()-Z | numeric | [-1, 1] | Time domain signal, mean for the jerk of the body acceleration on the Z axis. |
| tBodyAccJerk-std()-X | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the body acceleration on the X axis. |
| tBodyAccJerk-std()-Y | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the body acceleration on the Y axis. |
| tBodyAccJerk-std()-Z | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the body acceleration on the Z axis. |
| tBodyGyro-mean()-X | numeric | [-1, 1] | Time domain signal, mean for the angular velocity on the X axis. |
| tBodyGyro-mean()-Y | numeric | [-1, 1] | Time domain signal, mean for the angular velocity on the Y axis. |
| tBodyGyro-mean()-Z | numeric | [-1, 1] | Time domain signal, mean for the angular velocity on the Z axis. |
| tBodyGyro-std()-X | numeric | [-1, 1] | Time domain signal, standard deviation for the angular velocity on the X axis. |
| tBodyGyro-std()-Y | numeric | [-1, 1] | Time domain signal, standard deviation for the angular velocity on the Y axis. |
| tBodyGyro-std()-Z | numeric | [-1, 1] | Time domain signal, standard deviation for the angular velocity on the Z axis. |
| tBodyGyroJerk-mean()-X | numeric | [-1, 1] | Time domain signal, mean for the jerk of the angular velocity on the X axis. |
| tBodyGyroJerk-mean()-Y | numeric | [-1, 1] | Time domain signal, mean for the jerk of the angular velocity on the Y axis. |
| tBodyGyroJerk-mean()-Z | numeric | [-1, 1] | Time domain signal, mean for the jerk of the angular velocity on the Z axis. |
| tBodyGyroJerk-std()-X | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the angular velocity on the X axis. |
| tBodyGyroJerk-std()-Y | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the angular velocity on the Y axis. |
| tBodyGyroJerk-std()-Z | numeric | [-1, 1] | Time domain signal, standard deviation for the jerk of the angular velocity on the Z axis. |
| tBodyAccMag-mean() | numeric | [-1, 1] | Time domain signal, mean for the magnitude of the body acceleration. |
| tBodyAccMag-std() | numeric | [-1, 1] | Time domain signal, standard deviation for the magnitude of the body acceleration. |
| tGravityAccMag-mean() | numeric | [-1, 1] | Time domain signal, mean for the magnitude of the gravity acceleration. |
| tGravityAccMag-std() | numeric | [-1, 1] | Time domain signal, standard deviation for the magnitude of the gravity acceleration. |
| tBodyAccJerkMag-mean() | numeric | [-1, 1] | Time domain signal, mean for the magnitude of jerk, of the body accelaration. |
| tBodyAccJerkMag-std() | numeric | [-1, 1] | Time domain signal, standard deviation for the magnitude of jerk, of the body accelaration. |
| tBodyGyroMag-mean() | numeric | [-1, 1] | Time domain signal, mean for the magnitude of the angular velocity. |
| tBodyGyroMag-std() | numeric | [-1, 1] | Time domain signal, standard deviation for the magnitude of the angular velocity. |
| tBodyGyroJerkMag-mean() | numeric | [-1, 1] | Time domain signal, mean for the magnitude of jerk, of the angular velocity. |
| tBodyGyroJerkMag-std() | numeric | [-1, 1] | Time domain signal, standard deviation for the magnitude of jerk, of the angular velocity. |
| fBodyAcc-mean()-X | numeric | [-1, 1] | Frequency domain signal, mean for the body acceleration on the X axis. |
| fBodyAcc-mean()-Y | numeric | [-1, 1] | Frequency domain signal, mean for the body acceleration on the Y axis. |
| fBodyAcc-mean()-Z | numeric | [-1, 1] | Frequency domain signal, mean for the body acceleration on the Z axis. |
| fBodyAcc-std()-X | numeric | [-1, 1] | Frequency domain signal, standard deviation for the body acceleration on the X axis. |
| fBodyAcc-std()-Y | numeric | [-1, 1] | Frequency domain signal, standard deviation for the body acceleration on the Y axis. |
| fBodyAcc-std()-Z | numeric | [-1, 1] | Frequency domain signal, standard deviation for the body acceleration on the Z axis. |
| fBodyAccJerk-mean()-X | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the body acceleration on the X axis. |
| fBodyAccJerk-mean()-Y | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the body acceleration on the Y axis. |
| fBodyAccJerk-mean()-Z | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the body acceleration on the Z axis. |
| fBodyAccJerk-std()-X | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the body acceleration on the X axis. |
| fBodyAccJerk-std()-Y | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the body acceleration on the Y axis. |
| fBodyAccJerk-std()-Z | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the body acceleration on the Z axis. |
| fBodyGyro-mean()-X | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the angular velocity on the X axis. |
| fBodyGyro-mean()-Y | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the angular velocity on the Y axis. |
| fBodyGyro-mean()-Z | numeric | [-1, 1] | Frequency domain signal, mean for the jerk of the angular velocity on the Z axis. |
| fBodyGyro-std()-X | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the angular velocity on the X axis. |
| fBodyGyro-std()-Y | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the angular velocity on the Y axis. |
| fBodyGyro-std()-Z | numeric | [-1, 1] | Frequency domain signal, standard deviation for the jerk of the angular velocity on the Z axis. |
| fBodyAccMag-mean() | numeric | [-1, 1] | Frequency domain signal, mean for the magnitude of the body acceleration. |
| fBodyAccMag-std() | numeric | [-1, 1] | Frequency domain signal, standard deviation for the magnitude of the body acceleration. |
| fBodyBodyAccJerkMag-mean() | numeric | [-1, 1] | Frequency domain signal, mean for the magnitude of jerk, of the body acceleration. |
| fBodyBodyAccJerkMag-std() | numeric | [-1, 1] | Frequency domain signal, standard deviation for the magnitude of jerk, of the body acceleration. |
| fBodyBodyGyroMag-mean() | numeric | [-1, 1] | Frequency domain signal, mean for the magnitude of the angular velocity. |
| fBodyBodyGyroMag-std() | numeric | [-1, 1] | Frequency domain signal, standard deviation for the magnitude of the angular velocity. |
| fBodyBodyGyroJerkMag-mean() | numeric | [-1, 1] | Frequency domain signal, mean for the magnitude of jerk, of the angular velocity. |
| fBodyBodyGyroJerkMag-std() | numeric | [-1, 1] | Frequency domain signal, standard deviation for the magnitude of jerk, of the angular velocity. |
The avgSubjectActivityData dataset contains 180 rows and 68 columns.
Each row represents average of the measurements on 66 different aspects of an
activity (which is specified by the second column) performed by a subject (which
is specified by the first column).
Each of the 30 subjects performed 6 different activities:
- LAYING
- SITTING
- STANDING
- WALKING
- WALKING_UPSTAIRS
- WALKING_DOWNSTAIR
The table below shows the variables, their class, range and description.
| Variables | Class | Range | Description |
|---|---|---|---|
| Subject | integer | [1, 30] | Identification of a subject. |
| Activity | character | LAYING, SITTING, STANDING, WALKING, WALKING_UPSTAIRS, WALKING_DOWNSTAIRS | Description of the activity. |
| Avg-tBodyAcc-mean()-X | numeric | [-1, 1] | Time domain signal, average mean for the body acceleration on the X axis. |
| Avg-tBodyAcc-mean()-Y | numeric | [-1, 1] | Time domain signal, average mean for the body acceleration on the Y axis. |
| Avg-tBodyAcc-mean()-Z | numeric | [-1, 1] | Time domain signal, average mean for the body acceleration on the Z axis. |
| Avg-tBodyAcc-std()-X | numeric | [-1, 1] | Time domain signal, average standard deviation for the body acceleration on the X axis. |
| Avg-tBodyAcc-std()-Y | numeric | [-1, 1] | Time domain signal, average standard deviation for the body acceleration on the Y axis. |
| Avg-tBodyAcc-std()-Z | numeric | [-1, 1] | Time domain signal, average standard deviation for the body acceleration on the Z axis. |
| Avg-tGravityAcc-mean()-X | numeric | [-1, 1] | Time domain signal, average mean for the gravity acceleration on the X axis. |
| Avg-tGravityAcc-mean()-Y | numeric | [-1, 1] | Time domain signal, average mean for the gravity acceleration on the Y axis. |
| Avg-tGravityAcc-mean()-Z | numeric | [-1, 1] | Time domain signal, average mean for the gravity acceleration on the Z axis. |
| Avg-tGravityAcc-std()-X | numeric | [-1, 1] | Time domain signal, average standard deviation for the gravity acceleration on the X axis. |
| Avg-tGravityAcc-std()-Y | numeric | [-1, 1] | Time domain signal, average standard deviation for the gravity acceleration on the Y axis. |
| Avg-tGravityAcc-std()-Z | numeric | [-1, 1] | Time domain signal, average standard deviation for the gravity acceleration on the Z axis. |
| Avg-tBodyAccJerk-mean()-X | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the body acceleration on the X axis. |
| Avg-tBodyAccJerk-mean()-Y | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the body acceleration on the Y axis. |
| Avg-tBodyAccJerk-mean()-Z | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the body acceleration on the Z axis. |
| Avg-tBodyAccJerk-std()-X | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the body acceleration on the X axis. |
| Avg-tBodyAccJerk-std()-Y | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the body acceleration on the Y axis. |
| Avg-tBodyAccJerk-std()-Z | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the body acceleration on the Z axis. |
| Avg-tBodyGyro-mean()-X | numeric | [-1, 1] | Time domain signal, average mean for the angular velocity on the X axis. |
| Avg-tBodyGyro-mean()-Y | numeric | [-1, 1] | Time domain signal, average mean for the angular velocity on the Y axis. |
| Avg-tBodyGyro-mean()-Z | numeric | [-1, 1] | Time domain signal, average mean for the angular velocity on the Z axis. |
| Avg-tBodyGyro-std()-X | numeric | [-1, 1] | Time domain signal, average standard deviation for the angular velocity on the X axis. |
| Avg-tBodyGyro-std()-Y | numeric | [-1, 1] | Time domain signal, average standard deviation for the angular velocity on the Y axis. |
| Avg-tBodyGyro-std()-Z | numeric | [-1, 1] | Time domain signal, average standard deviation for the angular velocity on the Z axis. |
| Avg-tBodyGyroJerk-mean()-X | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the angular velocity on the X axis. |
| Avg-tBodyGyroJerk-mean()-Y | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the angular velocity on the Y axis. |
| Avg-tBodyGyroJerk-mean()-Z | numeric | [-1, 1] | Time domain signal, average mean for the jerk of the angular velocity on the Z axis. |
| Avg-tBodyGyroJerk-std()-X | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the angular velocity on the X axis. |
| Avg-tBodyGyroJerk-std()-Y | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the angular velocity on the Y axis. |
| Avg-tBodyGyroJerk-std()-Z | numeric | [-1, 1] | Time domain signal, average standard deviation for the jerk of the angular velocity on the Z axis. |
| Avg-tBodyAccMag-mean() | numeric | [-1, 1] | Time domain signal, average mean for the magnitude of the body acceleration. |
| Avg-tBodyAccMag-std() | numeric | [-1, 1] | Time domain signal, average standard deviation for the magnitude of the body acceleration. |
| Avg-tGravityAccMag-mean() | numeric | [-1, 1] | Time domain signal, average mean for the magnitude of the gravity acceleration. |
| Avg-tGravityAccMag-std() | numeric | [-1, 1] | Time domain signal, average standard deviation for the magnitude of the gravity acceleration. |
| Avg-tBodyAccJerkMag-mean() | numeric | [-1, 1] | Time domain signal, average mean for the magnitude of jerk, of the body accelaration. |
| Avg-tBodyAccJerkMag-std() | numeric | [-1, 1] | Time domain signal, average standard deviation for the magnitude of jerk, of the body accelaration. |
| Avg-tBodyGyroMag-mean() | numeric | [-1, 1] | Time domain signal, average mean for the magnitude of the angular velocity. |
| Avg-tBodyGyroMag-std() | numeric | [-1, 1] | Time domain signal, average standard deviation for the magnitude of the angular velocity. |
| Avg-tBodyGyroJerkMag-mean() | numeric | [-1, 1] | Time domain signal, average mean for the magnitude of jerk, of the angular velocity. |
| Avg-tBodyGyroJerkMag-std() | numeric | [-1, 1] | Time domain signal, average standard deviation for the magnitude of jerk, of the angular velocity. |
| Avg-fBodyAcc-mean()-X | numeric | [-1, 1] | Frequency domain signal, average mean for the body acceleration on the X axis. |
| Avg-fBodyAcc-mean()-Y | numeric | [-1, 1] | Frequency domain signal, average mean for the body acceleration on the Y axis. |
| Avg-fBodyAcc-mean()-Z | numeric | [-1, 1] | Frequency domain signal, average mean for the body acceleration on the Z axis. |
| Avg-fBodyAcc-std()-X | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the body acceleration on the X axis. |
| Avg-fBodyAcc-std()-Y | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the body acceleration on the Y axis. |
| Avg-fBodyAcc-std()-Z | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the body acceleration on the Z axis. |
| Avg-fBodyAccJerk-mean()-X | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the body acceleration on the X axis. |
| Avg-fBodyAccJerk-mean()-Y | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the body acceleration on the Y axis. |
| Avg-fBodyAccJerk-mean()-Z | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the body acceleration on the Z axis. |
| Avg-fBodyAccJerk-std()-X | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the body acceleration on the X axis. |
| Avg-fBodyAccJerk-std()-Y | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the body acceleration on the Y axis. |
| Avg-fBodyAccJerk-std()-Z | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the body acceleration on the Z axis. |
| Avg-fBodyGyro-mean()-X | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the angular velocity on the X axis. |
| Avg-fBodyGyro-mean()-Y | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the angular velocity on the Y axis. |
| Avg-fBodyGyro-mean()-Z | numeric | [-1, 1] | Frequency domain signal, average mean for the jerk of the angular velocity on the Z axis. |
| Avg-fBodyGyro-std()-X | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the angular velocity on the X axis. |
| Avg-fBodyGyro-std()-Y | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the angular velocity on the Y axis. |
| Avg-fBodyGyro-std()-Z | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the jerk of the angular velocity on the Z axis. |
| Avg-fBodyAccMag-mean() | numeric | [-1, 1] | Frequency domain signal, average mean for the magnitude of the body acceleration. |
| Avg-fBodyAccMag-std() | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the magnitude of the body acceleration. |
| Avg-fBodyBodyAccJerkMag-mean() | numeric | [-1, 1] | Frequency domain signal, average mean for the magnitude of jerk, of the body acceleration. |
| Avg-fBodyBodyAccJerkMag-std() | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the magnitude of jerk, of the body acceleration. |
| Avg-fBodyBodyGyroMag-mean() | numeric | [-1, 1] | Frequency domain signal, average mean for the magnitude of the angular velocity. |
| Avg-fBodyBodyGyroMag-std() | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the magnitude of the angular velocity. |
| Avg-fBodyBodyGyroJerkMag-mean() | numeric | [-1, 1] | Frequency domain signal, average mean for the magnitude of jerk, of the angular velocity. |
| Avg-fBodyBodyGyroJerkMag-std() | numeric | [-1, 1] | Frequency domain signal, average standard deviation for the magnitude of jerk, of the angular velocity. |