Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HoundDogDan/SmartphoneAccelerometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#run_analysis.R

run_analysis.R is the R script which cleans and produces a tidy data set named "tidydata.txt"

The R script uses data downloaded from: https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip

The original data set and the full description are available at the site where the data was obtained: http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones

About the script

The script follows this basic flow:

  • Read the source data
  • combine individual data (train + test)
  • re-name columns
  • remove unwanted columns (we only want those with mean() and std()
  • combine all data into one table
  • "lengthen" the data by subject and activity using melt (reshape2 library)
  • calculate the average using dcast (reshape2 library)
  • write the tidy data set

The tidy data set can be read with this R command:

''' d <- read.table("tidydata.txt", header=TRUE)

Requirements

R, R-Studio, reshape2 library

About

Smartphone Accelerometer data for Getting and cleaning data course

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages