This repository has a script developed to colect and process data from the reasearch described here.
The script basically merge the training and test data set and extract only the mean and standard deviation of each measurement made.
After that, a new data set is generated containing the mean of every measurement of the first data set aggregated by the subject that performed the activity and the activity itself.
Source data can be downloaded from the following link:
http://archive.ics.uci.edu/ml/machine-learning-databases/00240/UCI%20HAR%20Dataset.zip
Alternativelly, data can be obtained here
Both test and training data sets are merged, then the columns with mean and std of each measurement are kept on the data set, the others are removed. This filtering is made based on the name of the column, considering that columns storing the mean and standard deviation of each measurement have the mean() and std() suffix respectivelly.
Two columns are added in the data set, subject_id and activity. The first describe the subject that has performed the activity and the second the activity performed itself.
This data frame is used to generate a second data frame, with the average of each measurement from the first data set aggregated by the subject_id and activity.
Below we have the columns available on each data set, the contents of each column can be obtained on the documentation available on the research link supplied earlier on this document.
"subject_id"
"activity"
"tBodyAcc-mean()-X"
"tBodyAcc-mean()-Y"
"tBodyAcc-mean()-Z"
"tBodyAcc-std()-X"
"tBodyAcc-std()-Y"
"tBodyAcc-std()-Z"
"tGravityAcc-mean()-X"
"tGravityAcc-mean()-Y"
"tGravityAcc-mean()-Z"
"tGravityAcc-std()-X"
"tGravityAcc-std()-Y"
"tGravityAcc-std()-Z"
"tBodyAccJerk-mean()-X"
"tBodyAccJerk-mean()-Y"
"tBodyAccJerk-mean()-Z"
"tBodyAccJerk-std()-X"
"tBodyAccJerk-std()-Y"
"tBodyAccJerk-std()-Z"
"tBodyGyro-mean()-X"
"tBodyGyro-mean()-Y"
"tBodyGyro-mean()-Z"
"tBodyGyro-std()-X"
"tBodyGyro-std()-Y"
"tBodyGyro-std()-Z"
"tBodyGyroJerk-mean()-X"
"tBodyGyroJerk-mean()-Y"
"tBodyGyroJerk-mean()-Z"
"tBodyGyroJerk-std()-X"
"tBodyGyroJerk-std()-Y"
"tBodyGyroJerk-std()-Z"
"tBodyAccMag-mean()"
"tBodyAccMag-std()"
"tGravityAccMag-mean()"
"tGravityAccMag-std()"
"tBodyAccJerkMag-mean()"
"tBodyAccJerkMag-std()"
"tBodyGyroMag-mean()"
"tBodyGyroMag-std()"
"tBodyGyroJerkMag-mean()"
"tBodyGyroJerkMag-std()"
"fBodyAcc-mean()-X"
"fBodyAcc-mean()-Y"
"fBodyAcc-mean()-Z"
"fBodyAcc-std()-X"
"fBodyAcc-std()-Y"
"fBodyAcc-std()-Z"
"fBodyAcc-meanFreq()-X"
"fBodyAcc-meanFreq()-Y"
"fBodyAcc-meanFreq()-Z"
"fBodyAccJerk-mean()-X"
"fBodyAccJerk-mean()-Y"
"fBodyAccJerk-mean()-Z"
"fBodyAccJerk-std()-X"
"fBodyAccJerk-std()-Y"
"fBodyAccJerk-std()-Z"
"fBodyAccJerk-meanFreq()-X"
"fBodyAccJerk-meanFreq()-Y"
"fBodyAccJerk-meanFreq()-Z"
"fBodyGyro-mean()-X"
"fBodyGyro-mean()-Y"
"fBodyGyro-mean()-Z"
"fBodyGyro-std()-X"
"fBodyGyro-std()-Y"
"fBodyGyro-std()-Z"
"fBodyGyro-meanFreq()-X"
"fBodyGyro-meanFreq()-Y"
"fBodyGyro-meanFreq()-Z"
"fBodyAccMag-mean()"
"fBodyAccMag-std()"
"fBodyAccMag-meanFreq()"
"fBodyBodyAccJerkMag-mean()"
"fBodyBodyAccJerkMag-std()"
"fBodyBodyAccJerkMag-meanFreq()"
"fBodyBodyGyroMag-mean()"
"fBodyBodyGyroMag-std()"
"fBodyBodyGyroMag-meanFreq()"
"fBodyBodyGyroJerkMag-mean()"
"fBodyBodyGyroJerkMag-std()"
"fBodyBodyGyroJerkMag-meanFreq()"
"subject_id"
"activity"
"average tBodyAcc-mean()-X"
"average tBodyAcc-mean()-Y"
"average tBodyAcc-mean()-Z"
"average tBodyAcc-std()-X"
"average tBodyAcc-std()-Y"
"average tBodyAcc-std()-Z"
"average tGravityAcc-mean()-X"
"average tGravityAcc-mean()-Y"
"average tGravityAcc-mean()-Z"
"average tGravityAcc-std()-X"
"average tGravityAcc-std()-Y"
"average tGravityAcc-std()-Z"
"average tBodyAccJerk-mean()-X"
"average tBodyAccJerk-mean()-Y"
"average tBodyAccJerk-mean()-Z"
"average tBodyAccJerk-std()-X"
"average tBodyAccJerk-std()-Y"
"average tBodyAccJerk-std()-Z"
"average tBodyGyro-mean()-X"
"average tBodyGyro-mean()-Y"
"average tBodyGyro-mean()-Z"
"average tBodyGyro-std()-X"
"average tBodyGyro-std()-Y"
"average tBodyGyro-std()-Z"
"average tBodyGyroJerk-mean()-X"
"average tBodyGyroJerk-mean()-Y"
"average tBodyGyroJerk-mean()-Z"
"average tBodyGyroJerk-std()-X"
"average tBodyGyroJerk-std()-Y"
"average tBodyGyroJerk-std()-Z"
"average tBodyAccMag-mean()"
"average tBodyAccMag-std()"
"average tGravityAccMag-mean()"
"average tGravityAccMag-std()"
"average tBodyAccJerkMag-mean()"
"average tBodyAccJerkMag-std()"
"average tBodyGyroMag-mean()"
"average tBodyGyroMag-std()"
"average tBodyGyroJerkMag-mean()"
"average tBodyGyroJerkMag-std()"
"average fBodyAcc-mean()-X"
"average fBodyAcc-mean()-Y"
"average fBodyAcc-mean()-Z"
"average fBodyAcc-std()-X"
"average fBodyAcc-std()-Y"
"average fBodyAcc-std()-Z"
"average fBodyAcc-meanFreq()-X"
"average fBodyAcc-meanFreq()-Y"
"average fBodyAcc-meanFreq()-Z"
"average fBodyAccJerk-mean()-X"
"average fBodyAccJerk-mean()-Y"
"average fBodyAccJerk-mean()-Z"
"average fBodyAccJerk-std()-X"
"average fBodyAccJerk-std()-Y"
"average fBodyAccJerk-std()-Z"
"average fBodyAccJerk-meanFreq()-X"
"average fBodyAccJerk-meanFreq()-Y"
"average fBodyAccJerk-meanFreq()-Z"
"average fBodyGyro-mean()-X"
"average fBodyGyro-mean()-Y"
"average fBodyGyro-mean()-Z"
"average fBodyGyro-std()-X"
"average fBodyGyro-std()-Y"
"average fBodyGyro-std()-Z"
"average fBodyGyro-meanFreq()-X"
"average fBodyGyro-meanFreq()-Y"
"average fBodyGyro-meanFreq()-Z"
"average fBodyAccMag-mean()"
"average fBodyAccMag-std()"
"average fBodyAccMag-meanFreq()"
"average fBodyBodyAccJerkMag-mean()"
"average fBodyBodyAccJerkMag-std()"
"average fBodyBodyAccJerkMag-meanFreq()"
"average fBodyBodyGyroMag-mean()"
"average fBodyBodyGyroMag-std()"
"average fBodyBodyGyroMag-meanFreq()"
"average fBodyBodyGyroJerkMag-mean()"
"average fBodyBodyGyroJerkMag-std()"
"average fBodyBodyGyroJerkMag-meanFreq()"