Print the chosen few (the first and the last) items of a long vector
chosenFew(vec, start = 3, end = 1, collapse = ",")
A character string ready to be printed
In case the vector is shorter than the sum of start
and
end
, the whole vector is printed.
lvec1 <- 1:100
chosenFew(lvec1)
#> [1] "1,2,3,...,100"
chosenFew(lvec1, start=5, end=3)
#> [1] "1,2,3,4,5,...,98,99,100"
svec <- 1:8
chosenFew(svec)
#> [1] "1,2,3,...,8"
chosenFew(svec, start=5, end=4)
#> [1] "1,2,3,4,5,6,7,8"