Description for runanalysis.R
- the script reads data from x_test.txt and x_train.txt into two different dataframes.
- It merges these two dataframes into one
- It creates a vector that contains numbers of columns that we need
- It leaves in dataframe only the columns that we need
- It names the columns using the data from features.txt
- It adds the column with the corresponding activity using data from y_train.txt and y_test.txt
- It adds the column with the corresponding subject number using data from subject_train.txt and subject_test.txt
- It splits dataframe by Subject and Activity and then calculates the mean for every variable for every element of the split list
- It combines the data into matrix. Rows are Subject.Activity, columns are means for every variable for given combination of Subject and Activity.
- It writes the data down into tidy_matrix.txt