Hi, thanks for evaluating. Excuse my english !
All the code is in the run_analysis.R file.
The code is designed to work with all the file X_test.txt,X_train.txt,y_test.txt,y_train.txt,features.txt,subject_train.txt,subject_test.txt situated in the working directory.
The result of the point 5 is the variable EachActivitySubjectMean. The result of the point 1,2,3,4 is the variable datafinal. I didn't keep the feature variables containing meanFreq. The means calculated for the last point works with each couple of Activity and Subject.