Just to illustrate upon Martin's point:
a <- 1:5 # modified from c(1, 2, 3) to make the illustration easier
b <- c(TRUE, FALSE)
a[b] # behaves like a[c(TRUE, FALSE, TRUE, FALSE, TRUE)]
#> [1] 1 3 5
d <- c(FALSE, TRUE)
a[d] # behaves like a[c(FALSE, TRUE, FALSE, TRUE, FALSE)]
#> [1] 2 4
e <- c(TRUE)
a[e] # behaves like a[c(TRUE, TRUE, TRUE, TRUE, TRUE)]
#> [1] 1 2 3 4 5
f <- c(FALSE)
a[f] # behaves like a[c(FALSE, FALSE, FALSE, FALSE, FALSE)]
#> integer(0)
Created on 2019-02-27 by the reprex package (v0.2.1)