Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

selectSome

Extract elements of a vector for concise rendering


Description

Extract the first and last several elements of a vector for concise rendering; insert ellipses to indicate elided elements. This function is primarily meant for developer rather than end-user use.

Usage

selectSome(obj, maxToShow=5)

Arguments

obj

A vector.

maxToShow

The number of elements (including "...") to render.

Details

This function can be used in 'show' methods to give users exemplars of the tokens used in a vector. For example, an ExpressionSet built from a yeast experiment might have features enumerated using systematic gene names (e.g., YPR181C) or standard gene names (e.g., SEC23). The show method for ExpressionSet uses selectSome to alert the user to the tokens used, and thereby to indicate what vocabulary must be understood to work with the feature names.

Value

A string vector with at most maxToShow plus 1 elements, where an ellipsis ("...") is included to indicate incompleteness of the excerpt.

Author(s)

Martin Morgan <mtmorgan@fhcrc.org>

Examples

selectSome(1:20)

Biobase

Biobase: Base functions for Bioconductor

v2.50.0
Artistic-2.0
Authors
R. Gentleman, V. Carey, M. Morgan, S. Falcon
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.