Replaced merge with join as merge sorts in
 activity_train <- merge(activity_labels, activity_num_train, sort=FALSE)
and
 activity_test  <- merge(activity_labels, activity_num_test, sort=FALSE)