You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merges the training and the test sets to create one data set.
## Load features and name total X data column with featurefeatures<- read.table("UCI HAR Dataset/features.txt", header=FALSE)
## Load and combine all X data, then name its columnsdataTrainX<- read.table("UCI HAR Dataset/train/X_train.txt", header=FALSE)
dataTestX<- read.table("UCI HAR Dataset/test/X_test.txt", header=FALSE)
totalX<- rbind(dataTrainX, dataTestX)
names(totalX) <- as.character(features[, 2])
## Load and combine all y data, then name its columnsdataTrainy<- read.table("UCI HAR Dataset/train/y_train.txt", header=FALSE)
dataTesty<- read.table("UCI HAR Dataset/test/y_test.txt", header=FALSE)
totaly<- rbind(dataTrainy, dataTesty)
names(totaly) <- c("ActivityID")
## Load activities and set their column nameactivities<- read.table("UCI HAR Dataset/activity_labels.txt", head=FALSE)
names(activities) <- c("ActivityID", "Activity")
## Merge y data with activities data to get meaningful labeltotaly<- merge(totaly, activities, by.x="ActivityID", by.y="ActivityID",
all=FALSE)
## Load, combine and name all the subjectsubjectTrain<- read.table("UCI HAR Dataset/train/subject_train.txt", header=FALSE)
subjectTest<- read.table("UCI HAR Dataset/test/subject_test.txt", header=FALSE)
subject<- rbind(subjectTrain, subjectTest)
names(subject) <- c("Subject")
## Combine the whole data set into a single dataset name set1set1<- cbind(totalX, totaly, subject)
Extract only the measurements on the mean and standard deviation for each measurement