Hello,
I want to create a script to center my data along a value.
My quantification took different vaues along distance and to compare between observations I need to center them on the maximum value and select max+/-n values.
For example:
INPUT OUTPUT
A B C A B C
10 5 5 10 5 25
20 5 5 20 20 35
50 20 25 50 60 70
30 60 35 30 50 50
15 50 70 15 40 30
10 40 50
5 20 30
5 10 10
I've created this part of the script that calculates the top and bottom numbers for each column but I don't know how to proceed to select them.
#for bucle to detect the position of the max values
out_pos<-vector("double",ncol(x1))
for(i in seq_along(x1)) {
out_pos[[i]]<-which.max(x1[[i]])
}
out_pos
str(out_pos)
#delineate tops and bottoms
top<-out_pos-50
bot<-out_pos+50
top
bot
Any help will be more than welcome! Thanks!