I'm sure there is a simple solution, but I can't work it out and googling isn't helping me.
If I want to find the max of each row within the boundaries I do this:
temp.df$S1max <- apply(S1[135:175], 1, max)
But how can I apply this to regions outside of that bounds? This doesn't work:
temp.df$S1mean <- apply(S1[0:135, 175:300], 1, mean)
Thanks