I have a data array shown below and I have another vector that is the same length as the first dimension of the data array: b=c(-1, -0.5, 0, 0.5, 1). Is there a way in r to