Let's say I have a vector named ages and I bound the values of a vector to a limit:
# Create vector
ages <- c(1:7427) # This is not what my vector is actually assigned as btw, it has a lot of random floats in reality.
# Set limits
min_HB <- 11.68987
max_HB <- 11.81083
# Limit vector
HB_ages <- sapply(ages, function(y) min(max(y,min_HB),max_HB))
The HB_ages range is from 1 to length(HB_ages), but I would still like to get info on what are the indices of the values from the original vector. Is there a way to do this?