Attempts to figure out appropriate labels for S4 classes.

S4LabelFormat(x, type = "major", ...)

# S4 method for ANY
S4LabelFormat(x, type = "major", ...)

# S4 method for WoodenHorse
S4LabelFormat(x, type = "major", ...)

# S4 method for ANYGenomic
S4LabelFormat(x, type = "major", ...)

Arguments

x

A vector to format

type

Either "major" or "minor" to determine how to format the labels (default: "major").

...

Optional arguments passed to downstream functions (not implemented).

Value

A character vector of the same length as x with labels

Details

The type argument is currently only implemented for the GenomicRanges class.

Examples

# Regular atomic vectors S4LabelFormat(1:10)
#> [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
S4LabelFormat(LETTERS[1:5])
#> [1] "A" "B" "C" "D" "E"
require(GenomicRanges) # GenomicRanges major labels are seqnames S4LabelFormat(GPos("chr1", 1:10))
#> [1] "chr1" "chr1" "chr1" "chr1" "chr1" "chr1" "chr1" "chr1" "chr1" "chr1"
# GenomicRanges minor labels are positions formatted as basepairs S4LabelFormat(GPos("chr1", 1:10), type = "minor")
#> [1] "1 " "2 " "3 " "4 " "5 " "6 " "7 " "8 " "9 " "10"