Newbie here.
So I have matrix with dimension of 3*24. I am trying to find a mean of 3rd column if the value of 2nd column in greater/lower than x. All the values are numeric.
What I have been trying to do is as follow:
over40<-TrainExer11$Age>=40
below40<-TrainExer11$Age<40
The idea is to create another logical variable for each age group
colMeans(TrainExer11, below40=TRUE)
Then to find the mean of both variable only IF it fulfils the previous logical.
The code returned an error (obviously) but since I am not very familiar with R yet, I don't know how one should proceed