rxHexBin: Creates hexbin summaries.

Description Usage Arguments Examples

Description

Creates hexbin summaries.

Usage

1
rxHexBin(formula, data, shape = 1, xbins = 30, ...)

Arguments

formula

formula

data

xdf file

shape

shape parameter, passed to hexbin

xbins

Number of xbins, passed to hexbin

...

Other arguments, passed to rxDataStep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Load the Airlines Data
library(RevoScaleR)
working.file <- file.path(rxGetOption("sampleDataDir"), "AirlineDemoSmall.xdf")

library(RevoScaleR)
library(hexbin)
bin1 <- rxHexBin(ArrDelay ~ CRSDepTime, working.file, xbins = 50)
plot(bin1, lcex=.5, border = TRUE, colramp = BTC)
plot(bin1, style="colorscale")
plot(bin1, style="centroids")
plot(bin1, style="lattice")

library(ggplot2)
ggbin <- data.frame(
  hcell2xy(bin1),
  count = bin1@count,
  density = bin1@count / sum(bin1@count, na.rm=TRUE)
)
p2 <- ggplot(data = ggbin, aes(x, y, fill = count))
p2 + geom_hex(stat="identity", nbins = 100) +
  guides(fill = guide_colorbar(ticks = FALSE, label.theme = element_text(size = 8, angle = 0))) +
  labs(x = "CRSDepTime", y = "ArrDelay")

RevoEnhancements/RevoEnhancements documentation built on May 9, 2019, 9:46 a.m.