chosenFew: Print the chosen few items of a long vector

Description Usage Arguments Value Note Author(s) Examples

View source: R/vector.R

Description

Print the chosen few (the first and the last) items of a long vector

Usage

1
chosenFew(vec, start = 3, end = 1, collapse = ",")

Arguments

vec

A vector of characters or other types that can be cast into characters

start

Integer, how many elements at the start shall be printed

end

Integer, how many elements at the end shall be printed

collapse

Character used to separate elements

Value

A character string ready to be printed

Note

In case the vector is shorter than the sum of start and end, the whole vector is printed.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples

1
2
3
4
5
6
7
lvec1 <- 1:100
chosenFew(lvec1)
chosenFew(lvec1, start=5, end=3)

svec <- 1:8
chosenFew(svec)
chosenFew(svec, start=5, end=4)

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.