This project contains run_analysis.R: a script for tidying movement data as part of the Coursera Tidying Data project. See below for details on how to run the file and load the outputted data back into R. All variables, their units and transformations performed on the raw data are included in CookBook.md.
- R version 3.1.1
- The raw data zip file downloaded and unziped in the current working directory.
- Package plyr version 1.8.1
- Package reshape2 version 1.4
- Download run_analysis.R from github.
- Download the (dataset)[https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip] and extract it to the same directory as run_analysis.R. Do not alter any folder names or file names.
- Open an R console and set the working directory ("wd") to where you extracted the previous files.
- Run these R commands to run the script.
setwd("path\to\script_and_data")
source("run_analysis.R")
data <- read.table("tidy_data.txt", header=TRUE, stringsAsFactors = FALSE)
head(data)