Answers for "logical vector passed in R"

0

logical vector passed in R

a <- c(1, 2, 3, 4, 5)
a[c(TRUE, FALSE, TRUE, FALSE, TRUE)]
## [1] 1 3 5
Posted by: Guest on March-30-2021

Browse Popular Code Answers by Language