Git Product home page Git Product logo

coursera_tidydata's Introduction

README

This is the README file for the run_analysis.R script and it's output activity_averages.csv For complete details on source data see the README.txt file included with the original data For details on activity_averages.csv see CodeBook.md

Script Purpose

Create a new dataset containing the average of each variable selected from the original data set for each activity and each subject.

Requirements

This script assumes you are running OS X.

  • An empty working directory.
  • libraries: readr & tidyr

Script Variables

  • main.site: the main site containing the data to download
  • folder: the folder inside the zip file that contains the files needed
  • extract.files: the files, with subfolders if necessary, to extract from the zip file
  • data.files: all the files in the working directory after downloading and unzipping the source data
  • features: 561 features from features.txt
  • mead.std: identifiers for features containing mean or std (standard deviation) in their name
  • measurements: measurement data from files X_test.txt & X_train.txt
  • subject: subject ids from files subject_test.txt & subject_train.txt
  • activity.id: activity ids from files y_test.txt & y_train.txt
  • combined.data: subject + activity.id + measurements
  • averages: the mean of each of the 66 features selected, calculated by activity by subject

Script Process

Lines Process
3:9 prepare and check environment
12:28 download and extract files
31:37 load, identify mean and std, and clean up names of features
40:52 load and combine measurements, subject ids, and activity ids
55:58 load activity names and replace activity ids with names in combined data
61:68 calculate averages for each feature, grouped by subject and activity and create new data file

Source Data

Original data: accelerometer data collected from the Samsung Galaxy S. Variables selected: all mean and standard deviation variables identified with mean() & std().

Summary of features: Prefix 't' denotes time. Prefix 'f' denotes frequency. '-XYZ' is used to denote 3-axial signals in the X, Y and Z directions. Additional features obtained by averaging the signals in a sample window.

Examples: tBodyAcc-XYZ tBodyAccJerk-XYZ tBodyGyro-XYZ fBodyAcc-XYZ fBodyAccJerk-XYZ fBodyGyro-XYZ gravityMean tBodyAccMean tBodyAccJerkMean tBodyGyroMean tBodyGyroJerkMean

It is not necessary to download the source file in advance. The script will download and unzip the data. Details: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones Source: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip

License

See README.txt with the original dataset for license details

coursera_tidydata's People

Contributors

aquakora avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.