# NOT RUN {
a <-c(TRUE,FALSE,FALSE,TRUE,TRUE)
b <- the_row_number_of_logical_vector(a)
# Then, return value object, b is a vector of
#> b
# 1, 4, 5
# From this, we can count the TRUE, as following manner:
Number.of.TRUE <- length(b)
# Of course, it is:
#> Number.of.TRUE
# 3
length(b) == sum(a)
# }
Run the code above in your browser using DataLab