Skip to content

JamAtGit/datasciencecoursera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting and Cleaning Data - Course Project

This is the course project for the Getting and Cleaning Data Coursera course. The R script, run_analysis.R, does the following:

  1. Sets path
  2. Loads the activity and feature info
  3. Loads both the training and test datasets, keeping only those columns which reflect a mean or standard deviation
  4. Loads the activity and subject data for each dataset, and merges those columns with the dataset
  5. Merges the two datasets
  6. Converts the activity and subject columns into factors
  7. Creates a tidy dataset that consists of the average (mean) value of each variable of interest for each subject and activity pair.

The end result is shown in the file alldataSet.txt.

##How to run

  1. Open the R script run_analysis.R using RStudio
  2. Set the working path depending on your directories structure call to the working directory/folder (i.e., the folder where these the R script file is saved).
  3. Run the R script run_analysis.R

Procedure

  • it Merges the training and the test sets to create one data set.
  • Extracts only the measurements on the mean and standard deviation for each measurement.
  • Uses descriptive activity names to name the activities in the data set
  • Appropriately labels the data set with descriptive activity names.
  • Creates a second, independent tidy data set with the average of each variable of interest for each activity and each subject. it's called allDataSet.txt

##data set description The dataset includes the following files:

'README.txt'

'features_info.txt': Shows information about the variables used on the feature vector.

'features.txt': List of all features.

'activity_labels.txt': Links the class labels with their activity name.

'train/X_train.txt': Training set.

'train/y_train.txt': Training labels.

'test/X_test.txt': Test set.

'test/y_test.txt': Test labels.

The following files are available for the train and test data. Their descriptions are equivalent.

'train/subject_train.txt': Each row identifies the subject who performed the activity for each window sample. Its range is from 1 to 30.

'train/Inertial Signals/total_acc_x_train.txt': The acceleration signal from the smartphone accelerometer X axis in standard gravity units 'g'. Every row shows a 128 element vector. The same description applies for the 'total_acc_x_train.txt' and 'total_acc_z_train.txt' files for the Y and Z axis.

'train/Inertial Signals/body_acc_x_train.txt': The body acceleration signal obtained by subtracting the gravity from the total acceleration.

'train/Inertial Signals/body_gyro_x_train.txt': The angular velocity vector measured by the gyroscope for each window sample. The units are radians/second.

tidy data file will contain following measures:

  • subject
  • activity
  • featDomain
  • featAcceleration
  • featInstrument
  • featJerk
  • featMagnitud
  • efeatVariable
  • featAxis
  • count
  • average

About

Data Scientists repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages