As per requirement, You should create one R script called run_analysis.R that does the following.
- 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 for each activity and each subject.
You need to install and load reshape2
and data.table
before executing following steps.
-
https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip Download the data source from this link and put into a folder. You'll have a
UCI HAR Dataset
folder. Make sure it's in your project folder. -
Required
run_analysis.R
of your project should be in your main project folder withUCI HAR Dataset
. Necessary step after this is setting up your working direcory. It can be done by two ways: Session toolbar from R-Studio OR you can do it by usingsetwd()
function. -
Open and run
source("run_analysis.R")
,required_tidydata.txt
will be generated in your working directory as output of your project.