labels.countries: Compute a unique 'sf' to optimize the position of labels

View source: R/functions.R

labels.countriesR Documentation

Compute a unique sf to optimize the position of labels

Description

Displaying labels on a map is complicated because of serious overlapping problems. Labels for different kinds of entities can be put in a unique sf

Usage

## S3 method for class 'countries'
labels(object, ..., var)

Arguments

object

a countries object',

...

further arguments (currently unused),

var

a character vector indicating the entities that should be labeleld, it can be country, capital and towns

Value

a sf containing:

  • name the names of the entities,

  • type the type of the entity (either country, capitalandtowns')

  • point the coordinate of the points (obtained using st_point_on_surface for countries)


necountries documentation built on April 4, 2025, 1:43 a.m.