View source: R/stat_signPoint.R
stat_signPoint | R Documentation |
stat_signPoint
stat_signPoint(
mapping = NULL,
data = NULL,
geom = "point",
position = "identity",
show.legend = NA,
inherit.aes = TRUE,
...,
fact = 1
)
geom_signPoint(
mapping = aes(),
data = NULL,
stat = "signPoint",
position = "identity",
show.legend = NA,
inherit.aes = TRUE,
...,
fact = 1
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
The geometric object to use to display the data for this layer.
When using a
|
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
show.legend |
logical. Should this layer be included in the legends?
You can also set this to one of "polygon", "line", and "point" to override the default legend. |
inherit.aes |
If |
... |
Other arguments passed on to
|
fact |
postive integer. Plot one point in |
stat |
The statistical transformation to use on the data for this layer.
When using a
|
geom_signPoint()
requires the following aesthetics:
x
:
y
:
mask
(optional): Boolean, mask=TRUE
is regarded as significant.
Only plot regions with mask = TRUE
.
library(gg.layers)
library(ggplot2)
data("d_trendPerc")
d_mask <- mutate(d_trendPerc, mask = perc <= 0.99) # %>% as.data.frame()
# the part of not significant
ggplot(data = d_mask, aes(x, y)) +
geom_raster(aes(fill = perc)) +
geom_signPoint(aes(mask = !mask), fact = 2, shape = 4)
# significant
ggplot(data = d_mask, aes(x, y)) +
geom_raster(aes(fill = perc)) +
geom_signPoint(aes(mask = mask), fact = 2)
## Another option
fact = 2
ggplot(data = d_mask, aes(x, y)) +
geom_raster(aes(fill = perc)) +
geom_point(data = ~ resample_points(.x, fact))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.