geom_histogram: Histograms.

Description Usage Arguments Examples

Description

Display a 1d distribution by dividing into bins and counting the number of observations in each bin. Histograms use bars.

stat_bin is suitable only for continuous x data. If your x data is discrete, you probably want to use stat_count.

Usage

1
2
3
4
geom_histogram(mapping = NULL, data = NULL, stat = "bin",
  binwidth = NULL, bins = NULL, origin = NULL, right = FALSE,
  position = "stack", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

Set of aesthetic mapping created by aes or aes_.

data

The data to be displayed in this layer.

stat

Use override the default connection between geom_histogram, geom_freqpoly and stat_bin

binwidth

???

bins

Does not use in ggplot2.SparkR

origin

Does not use in ggplot2.SparkR

right

Does not use in ggplot2.SparkR

position

Position adjustment, either as a string, or the result of a call to a position adjustment function.

na.rm

Not used in ggplot2.SparkR

show.legend

logical. Should this layer be included in the legends?

inherit.aes

If FALSE, overrides the default aesthetics, rather ehan combining with them.

...

other arguments passed on to layer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
ggplot(faithful, aes(eruptions)) + geom_histogram()

df <- createDataFrame(sqlContext, faithful)
ggplot(df, aes(eruptions)) + geom_histogram()
ggplot(df, aes(eruptions)) + geom_histogram(binwidth = 5)

ggplot(df, aes(eruptions, fill = waiting)) + geom_histogram()

## End(Not run)

SKKU-SKT/ggplot2.SparkR documentation built on May 9, 2019, 11:13 a.m.