creating a summary table with specific formula

See the FAQ: How to do a minimal reproducible example reprex for beginners for a more directed answer.

vec <- c(42, 3, 96, 83, 6, 24, 52, 5, 86, 47, 78, 67, 98, 23, 88, 44, 32, 75, 60, 41, 55, 21, 68, 93, 38, 22, 61, 37, 19, 13, 56, 15, 73, 74, 12, 97, 40, 62, 79, 58, 59, 18, 20, 51, 81, 48, 17, 80, 84, 27)

vec[which.max(vec) - 10]
#> [1] 96