The goal: I want to create 2 new columns by using R.
1 column which shows the mean of each row (but only calculating specific columns - only the mean of the columns which do not contain the string "_X")
1 column which shows the mean of each row (but only calculating specific columns - only the mean of the columns which do contain the string "_X").
For example:
phone1 phone1_X phon2 phone2_X phone3 phone3_X
1 2 3 4 5 6
2 4 6 8 10 12

Results:
Mean_of_none_X
3 (1+3+5)/3
6 (2+5+10)3
Mean_of_X
4
8
Thank you!