ggplot2
stat_chull.Rd
Create a layer of convex hull for ggplot2 plots.
stat_chull(
mapping = NULL,
data = NULL,
geom = "polygon",
position = "identity",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
Source: vignette Extending ggplot2
Set of aesthetic mappings created by aes
or aes_
. If specified and inherit.aes = TRUE
(the
default), it is combined with the default mapping at the top level of the
plot. You must supply mapping
if there is no plot mapping.
A layer specific dataset - only needed if you want to override the plot defaults.
The geometric object to use display the data.
The position adjustment to use for overlapping points on this layer.
If FALSE
(the default), removes missing values with a warning.
If TRUE
silently removes missing values.
logical. Should this layer be included in the legends?
NA
, the default, includes if any aesthetics are mapped.
FALSE
never includes, and TRUE
always includes.
If FALSE
, overrides the default aesthetics,
rather than combining with them. This is most useful for helper functions
that define both data and aesthetics and shouldn't inherit behaviour from
the default plot specification, e.g. borders
.
Other arguments passed on to layer
. These are
often aesthetics, used to set an aesthetic to a fixed value, like
color = "red"
or size = 3
.
Layer of convex hull for ggplot2 plots.
Other spHelper plots:
check_palette()
,
layer_spRangeMean()
,
plot_colors()
,
plot_hyPalette()
,
plot_spCompare()
,
plot_spDiff()
,
plot_spDistribution()
,
qplot_confusion()
,
qplot_crosstab()
,
qplot_infoDim()
,
qplot_kAmp()
,
qplot_kSp()
,
qplot_prediction()
,
qplot_spRangeCenter()
,
qplot_spRangeMedian()
,
qplot_spStat()
,
qplot_spc()
,
rmExpr()
,
rm_stripes()
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
stat_chull(fill = NA, colour = "black")
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
stat_chull(fill = NA)
ggplot(mpg, aes(displ, hwy)) +
stat_chull(geom = "point", size = 4, colour = "red") +
geom_point()