| build_sf_inset_layers {ggmapinset} | R Documentation | 
Build layers to implement an inset-compatible geometry
Description
For plotting, use geom_sf_inset() instead. This helper is intended to be used when
implementing custom geometries based on geom_sf_inset() so that they can provide
parameters to control the inset.
Usage
build_sf_inset_layers(
  data,
  mapping,
  stat,
  position,
  show.legend,
  inherit.aes,
  params,
  inset,
  map_base = "normal",
  map_inset = "auto"
)
Arguments
| data | The data to be displayed in this layer. There are three options: If  A  A  | 
| mapping | Set of aesthetic mappings created by  | 
| stat | The statistical transformation to use on the data for this
layer, either as a  | 
| position | Position adjustment, either as a string naming the adjustment
(e.g.  | 
| show.legend | logical. Should this layer be included in the legends?
 | 
| inherit.aes | If  | 
| params | Additional parameters to the  | 
| inset | Inset configuration; see  | 
| map_base | Controls the layer with the base map. Possible values are
 | 
| map_inset | Controls the layer with the inset map. Possible values are
 | 
Value
A ggplot layer, or a pair of layers.
Examples
my_custom_geom <- function(mapping = ggplot2::aes(),
                           data = NULL,
                           stat = "my_custom_stat",
                           position = "identity",
                           ...,
                           inset = NA,
                           map_base = "normal",
                           map_inset = "auto",
                           na.rm = TRUE,
                           inherit.aes = TRUE) {
  params <- rlang::list2(na.rm = na.rm, ...)
  build_sf_inset_layers(data = data, mapping = mapping,
                        stat = stat, position = position,
                        show.legend = show.legend,
                        inherit.aes = inherit.aes,
                        params = params,
                        inset = inset,
                        map_base = map_base,
                        map_inset = map_inset)
}