Skip to content

Latest commit

 

History

History
138 lines (118 loc) · 5.06 KB

File metadata and controls

138 lines (118 loc) · 5.06 KB

Code Book

Opening Comments

The syntax in this repo produces two data.frames.

+ combined and
+ combined_simplified

The files used to produce them mirror the object's name. I will describe each data set below. Each description will include the dimensions of the object, the column names of the object and where the data in each column comes from.

Combined

The file, combined.R, produces the data.frame called combined. This is the output I created to satisfy steps 1 - 4.

Why is it tidy? It is tidy because it has a unique per row combination of subject, stat_group and activity. Each subject / activity has, at most, a single row. No more. Each column measures the output from the phone for the measure represented by the column name.

Object Dimensions

  • 10299 rows.
  • 23 columns.

Column Names - Source - Description

  • subject - Subject Identifier - Comes from subject_test and subject_train
  • stat_group - Either test or train, depending on which data set they came from.
  • activity - Subject's Activity - Comes from y_test and y_train
  • x_avg - Average X - Comes from X_test and X_train
  • x_std_dev - Standard Deviation of X - Comes from X_test and X_train
  • body_acc_x_avg - Average Body Acc X - Comes from body_acc_x_test and body_acc_x_train
  • body_acc_x_std_dev - Standard Deviation of Body Acc X - Comes from body_acc_x_test and body_acc_x_train
  • body_acc_y_avg - Average Body Acc Y - Comes from body_acc_y_test and body_acc_y_train
  • body_acc_y_std_dev- Standard Deviation of Body Acc Y - Comes from body_acc_y_test and body_acc_y_train
  • body_acc_z_avg - Standard Deviation of Body Acc Z - Comes from body_acc_z_test and body_acc_z_train
  • body_acc_z_std_dev - Standard Deviation of Body Acc Z - Comes from body_acc_z_test and body_acc_z_train
  • body_gyro_x_avg - Average Body Gyro X - Comes from body_gyro_x_test and body_gyro_x_train
  • body_gyro_x_std_dev - Standard Deviation of Body Gyro X - Comes from body_gyro_x_test and body_gyro_x_train
  • body_gyro_y_avg - Average Body Gyro Y - Comes from body_gyro_y_test and body_gyro_y_train
  • body_gyro_y_std_dev- Standard Deviation of Body Gyro Y - Comes from body_gyro_y_test and body_gyro_y_train
  • body_gyro_z_avg - Standard Deviation of Body Gyro Z - Comes from body_gyro_z_test and body_gyro_z_train
  • body_gyro_z_std_dev - Standard Deviation of Body Gyro Z - Comes from body_gyro_z_test and body_gyro_z_train
  • total_acc_x_avg - Average Total Acc X - Comes from total_acc_x_test and total_acc_x_train
  • total_acc_x_std_dev - Standard Deviation of Total Acc X - Comes from total_acc_x_test and total_acc_x_train
  • total_acc_y_avg - Average Total Acc Y - Comes from total_acc_y_test and total_acc_y_train
  • total_acc_y_std_dev- Standard Deviation of Total Acc Y - Comes from total_acc_y_test and total_acc_y_train
  • total_acc_z_avg - Standard Deviation of Total Acc Z - Comes from total_acc_z_test and total_acc_z_train
  • total_acc_z_std_dev - Standard Deviation of Total Acc Z - Comes from total_acc_z_test and total_acc_z_train

Combined Simplified

The file, combined_simplified.R, produces the data.frame called combined_simplified. This is the output I created to satisfy step 5.

Why is it tidy? It is tidy because it each subject has at most one row. The columns each measure a data componenet (x, gyro x, etc.) but each row in the data set represents a single person.

Object Dimensions

  • 30 rows.
  • 44 columns.

Column Names

The column names for the simplified data.frame parallel the combined data.frame. The big difference is that combined is measuing activities per subject. combined_simplified measures people.

  • subject
  • stat_group
  • walking_x_avg
  • walking_upstairs_x_avg
  • walking_downstairs_x_avg
  • sitting_x_avg
  • standing_x_avg
  • laying_x_avg
  • walking_body_acc_x_avg
  • walking_upstairs_body_acc_x_avg
  • walking_downstairs_body_acc_x_avg
  • sitting_body_acc_x_avg
  • standing_body_acc_x_avg
  • standing_body_acc_x_avg
  • walking_body_acc_y_avg
  • walking_upstairs_body_acc_y_avg
  • walking_downstairs_body_acc_y_avg
  • sitting_body_acc_y_avg
  • standing_body_acc_y_avg
  • laying_body_acc_y_avg
  • walking_body_acc_z_avg
  • walking_upstairs_body_acc_z_avg
  • walking_downstairs_body_acc_z_avg
  • sitting_body_acc_z_avg
  • standing_body_acc_z_avg
  • laying_body_acc_z_avg
  • walking_body_gyro_x_avg
  • walking_upstairs_body_gyro_x_avg
  • walking_downstairs_body_gyro_x_avg
  • sitting_body_gyro_x_avg
  • standing_body_gyro_x_avg
  • laying_body_gyro_x_avg
  • walking_body_gyro_y_avg
  • walking_upstairs_body_gyro_y_avg
  • walking_downstairs_body_gyro_y_avg
  • sitting_body_gyro_y_avg
  • standing_body_gyro_y_avg
  • laying_body_gyro_y_avg
  • walking_body_gyro_z_avg
  • walking_upstairs_body_gyro_z_avg
  • walking_downstairs_body_gyro_z_avg
  • sitting_body_gyro_z_avg
  • standing_body_gyro_z_avg
  • laying_body_gyro_z_avg