I would like to be able to choose the max value from each comparison in a vector. I have two vectors:
probsA<-posttheta_A^R*(1-posttheta_A)^NR
#2.634872e-02 6.709075e-03 1.107573e-04 1.708307e-03 2.820171e-05
probsB<-posttheta_B^R*(1-posttheta_B)^NR
#0.0013311712 0.0012295459 0.0009688963 0.0011356790 0.0008949280
choice<-max(probsA,probsB)
0.02634872
the max function is searching for the biggest out of 10 values and prints it. I would like it to compare each element in each vector with its corresponding element and print 5 results.