transform.condensed: Transform condensed objects, collapsing unique bins.

Description Usage Arguments Details Examples

View source: R/rebin.r

Description

Transform condensed objects, collapsing unique bins.

Usage

1
2
3
\method{transform}{condensed}(`_data`, ...)

rebin(data)

Arguments

...

named arguments evaluated in the context of the data

data,'_data'

a condensed summary

Details

You don't need to use rebin if you use transform: it will automatically rebin for you. You will need to use it if you manually transform any grouping variables.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
x <- runif(1e4, -1, 1)
xsum <- condense(bin(x, 1 / 50))

# Transforming by hand: must use rebin
xsum$x <- abs(xsum$x)
rebin(xsum)
if (require("ggplot2")) {
  autoplot(xsum) + geom_point()
  autoplot(rebin(xsum)) + geom_point()
}

#' Transforming with transform
y <- x ^ 2 + runif(length(x), -0.1, 0.1)
xysum <- condense(bin(x, 1 / 50), z = y)
xysum <- transform(xysum, x = abs(x))
if (require("ggplot2")) {
  autoplot(xysum)
}

hadley/bigvis documentation built on May 17, 2019, 9:45 a.m.