Each row in my dataset has 8 cases in it and I need to find the average of 7 of them, excluding the lowest value.
So, for instance, my first row goes as it follows:
15 13 8 22 20 12 8 8
So, the lowest value will be 8, then the average of the 7 remaining cases will be 14. Obviously, I wouldn't want to do this by hand so is there a function that will allow me to do it directly in R?
I used the apply(data,1,min)
function to find the lowest value for each row. Is there a way to get R to give me the average of each row whilst excluding the respective minimum values from this average?
Thanks!