R vector: Exclude several elements



examples/vectors/exclude_elements.R
distances = c(11, 12, 13, 14, 15, 16, 17, 18)

print(distances[-c(2, 4)])  # 11 13 15 16 17 18
print(distances[-(2:4)])    # 11 15 16 17 18