popcircle: Proportional Circles and Shapes

Description Usage Arguments Details Value Examples

View source: R/main.R

Description

Get proportional circles and with polygons indide using a compact layout.

Usage

1

Arguments

x

an sf POLYGON or MULTIPOLYGON object

var

name of the numeric field in x to get proportionalities.

Details

Polygons are not proportional, they are rescaled to fit the circles.

Value

A list of length 2 of circles and shapes sf objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(sf)
library(popcircle)
mtq <- st_read(system.file("gpkg/mtq.gpkg", package="popcircle"))
res <- popcircle(x = mtq, var = "POP")
circles <- res$circles
shapes <- res$shapes
par(mar = c(0,0,0,0))
plot(st_geometry(circles), col = "darkseagreen", border = "darkseagreen1")
plot(st_geometry(shapes), col = "red", add = TRUE, lwd = 1, border = "red4")
if(require(cartography)){
  labelLayer(x = circles[1:10,], txt = "LIBGEO", halo = TRUE, overlap = FALSE)
}

rCarto/popcircle documentation built on May 3, 2019, 8:36 p.m.