This function follows the squish
function,
but allows extentions that work with objects other than numeric vectors.
squishThis(x, range = NULL, only.finite = TRUE, aes = "z") # S4 method for WoodenHorse,ANY squishThis(x, range = c(0, 1), only.finite = TRUE, aes = "z") # S4 method for numeric,numeric_OR_missing squishThis(x, range = c(0, 1), only.finite = TRUE, aes = "z") # S4 method for Rle,numeric_OR_missing squishThis(x, range = c(0, 1), only.finite = TRUE, aes = "z") # S4 method for IntegerRanges,numeric_OR_missing squishThis(x, range = c(0, 1), only.finite = TRUE, aes = "z") # S4 method for ANYGenomic,GRanges squishThis(x, range = GRanges(NA_character_, IRanges(0, 1)))
x | A vector of values to manipulate. |
---|---|
range | A range representing object. |
only.finite | If |
aes | An aesthetic for which to evaluate the function. |
The x
argument, but with out-of-bounds values squished to the
range.
#> [1] 0.0 0.5 1.0 1.0 NA#> numeric-Rle of length 10 with 2 runs #> Lengths: 7 3 #> Values : 2 3