I was wondering how to always pick the middle element in a numeric vector that is sorted from smallest to largest?
When the number of elements is even-numbered, then the smaller element of the two middle elements is desired. Here is an example with the desired output.
g1 = c(8,12,16,24)
g2 = c(8,12,16,24,32)
g3 = c(8,12)
g4 = 8
# Desired Output:
g1 = 12; g2 = 16, g3 = 8, g4 = 8