Selecting multiple elements with [

  • using logical vector having same length as x (often using comparisons)
x[!is.na(x)]
x[y > 0]