Skip to contents

Smooth

Usage

bt_smooth(
  bertin,
  data,
  values,
  stroke = "white",
  strokeWidth = 0.5,
  strokeLinecap = "round",
  strokeDasharray = "none",
  strokeLinejoin = "round",
  fillOpacity = 1,
  strokeOpacity = 1,
  display = TRUE,
  fill = "RdYlGn",
  thresholds = 100,
  bandwidth = 5,
  colorcurve = 2,
  reverse = FALSE,
  remove = 0,
  clip = FALSE,
  grid_step = 20,
  grid_blur = 0,
  grid_operator = "sum",
  grid_geoprocessing = "intersection"
)

Arguments

bertin

map object

data

sf object EPSG:4326

values

a string corresponding to the targeted variable in the properties

stroke

stroke color

strokeWidth

stroke width

strokeLinecap

appearance of the line cap

strokeDasharray

stroke dash array

strokeLinejoin

appearance of the intersection beetween two or several lines

fillOpacity

fill opacity

strokeOpacity

stroke opacity

display

Boolean to allow to show or hide the layer. This parameter has no effect on the calculation of the extent

fill

fill color

thresholds

number of classes

bandwidth

bandwidth (the standard deviation) of the Gaussian kernel and returns the estimate.

colorcurve

a value to curve the color interpolation

reverse

a boolean. By default, the layer placed on the topof the code is display on the top of the map.With reverse : true, your can reverse this order

remove

number of polygons to remove

clip

a boolean to avoid artifacts of discontinuous projection

grid_step

Gap between the points

grid_blur

radius of the kernel

grid_operator

operator 'sum' for absolute quantitative data or 'mean' for relative data (default: 'sum'. highly recommended)

grid_geoprocessing

intersection (intersection between polygons and grid squares. Assignment of values in proportion to the intersected area) or 'dotinpoly' (considers each grid square and assigns the value of the underlying polygon or the weighted average of intersecting polygons. )

Value

a map object

Examples

library(sf)
world <- st_read(system.file("gpkg/world.gpkg", package = "bertin"),
                 layer = "world", quiet = TRUE)
bt_layer(data = world, fill = "#808080") |>
  bt_smooth(data = world, values = "pop",
            thresholds = 50,
            bandwidth = 25,
            colorcurve = 1) |>
  bt_draw()