squish_infiniteThis: Squish infinite values to range

Description Usage Arguments Value Examples

Description

This function follows the squish_infinite function, but allows extentions that work with other objects than numeric vectors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
squish_infiniteThis(x, range = NULL, aes = "z")

## S4 method for signature 'numeric,numeric_OR_missing'
squish_infiniteThis(x, range = c(0, 1), aes = "z")

## S4 method for signature 'Rle,numeric_OR_missing'
squish_infiniteThis(x, range = c(0, 1), aes = "z")

## S4 method for signature 'WoodenHorse,numeric_OR_missing'
squish_infiniteThis(x, range = c(0, 1), aes = "z")

Arguments

x

A vector of values to manipulate.

range

A range representing object.

aes

An aesthetic for which to evaluate the function.

Value

The x argument, but with infinite values squished to the range.

Examples

1
2
3
4
5
# For regular numeric vectors
squish_infiniteThis(c(-Inf, -1, 0, 1, 2, Inf))

# For Rle-class
squish_infiniteThis(Rle(c(Inf, 2, 3, -Inf), 1:4), c(2, 3))

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