logical vector passed in R code example Example: logical vector passed in R a <- c(1, 2, 3, 4, 5) a[c(TRUE, FALSE, TRUE, FALSE, TRUE)] ## [1] 1 3 5