Filter values
examples/vectors/filter_values.R
values = c(17, 3, 28, 5) large_logic = values > 10 large = values[large_logic] print(large) # 17, 28
examples/vectors/filter.R
n = c(2, 4, 7, 6, 9, 8) n[ n > 4 ] n[ n > 4 & n %% 2] # grater than for and non-zero modulus 2 # n[ some-logical-vector ] to filter certain values and create a shorter vector n[ n >= 4 ]