S4Train: Scale training

Description Usage Arguments Value Examples

Description

Function for updating the scale range given a new and existing range.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature ''NULL',ANY'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'WoodenHorse,ANY'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'ANY,ANY'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'knownDiscretes,knownDiscretes_OR_missing'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'IntegerRanges,numeric_OR_missing'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'GenomicRanges,GRanges_OR_missing'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, ..., aes = "z")

## S4 method for signature 'Rle,ANY'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, aes = "z")

## S4 method for signature 'Factor,ANY'
S4Train(new, existing = NULL, drop = FALSE, na.rm = FALSE, aes = "z")

Arguments

new

An object representing the current range

existing

An object representing the new range

drop

When TRUE, will drop factor levels not associated with data. Used in discrete scales.

na.rm

When TRUE, will remove missing values. Used in discrete scales.

...

Arguments passed down to downstream methods. Currently used for discrete scales.

aes

An aesthetic for which to evaluate the range

Value

An updated representation of a range

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# For plain numeric vectors
S4Train(new = 1:10, existing = c(-5, -15))

# IRanges return plain limits
require(IRanges)
S4Train(new = IRanges("2501-2900"), existing = c(2000, 2500))

# For GenomicRanges
require(GenomicRanges)
S4Train(new = GRanges(c("chr1:100-200", "chr2:1-2")),
        existing = GRanges(c("chr2:200-300")))

teunbrand/ggnomics documentation built on Aug. 2, 2020, 7:34 p.m.