Programmatic Access to Glottography Speaker Area Polygons

Provides programmatic access to Glottography, an online repository of geospatial speaker-area polygons for the world's languages. The package allows users to list available datasets, download and install them, and load speaker-area polygons as standard spatial 'sf' objects in R. Data are sourced from either the Glottography organization on GitHub < https://github.com/Glottography> or the Glottography community on Zenodo < https://zenodo.org/communities/glottography>. Based on Ranacher et al. (2026) .


Rglottography

Rglottography provides programmatic access to the Glottography dataset, a collection of language area polygons hosted on Zenodo and GitHub. The package allows users to list available datasets, download them, and load them as standard spatial (sf) objects in R.


Intended Users

Linguists, geographers, cultural anthropologists, and others working with areal linguistic data.


Core Functionality

  • set_cache_dir(path): Set the location of the cache directory.
  • list_datasets(): Lists all available Glottography datasets.
  • download_dataset(dataset): Downloads one or more datasets to the local cache.
  • load_glottography(dataset, install_missing = TRUE): Loads downloaded datasets as sf spatial objects.

Optional Functions

  • set_cache_dir(path): Sets a custom location for the cache directory. Use this if you want to change where datasets are stored.

Data Model and Storage

  • Datasets are organised by scientific source publication.
  • To avoid repeated downloads, datasets are cached in a user-specific directory (default: tools::R_user_dir("Rglottography", "data")). Users can change this location using set_cache_dir().
  • Metadata is shipped with the package in inst/extdata/registry.json and copied to the cache directory.

Design Principles

  • Datasets are only downloaded when requested.
  • All outputs are returned as standard spatial (sf) objects for compatibility with geospatial analysis in R.

Installation

You can install the development version of Rglottography from GitHub using remotes. If not already installed, first install remotes, then use it to install Rglottography from GitHub:

# install.packages("remotes")
remotes::install_github("Glottography/Rglottography")

Example

The following commands demonstrate usage:

library(Rglottography)

# List available datasets
list_datasets()

# Load the dataset matsumae2021exploring, downloading it on first use.
glottography <- load_datasets("matsumae2021exploring", install_missing = TRUE)
languages <- glottography$languages

See the package vignettes for more detailed examples.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("Rglottography")

1.2.0 by Peter Ranacher, 7 months ago


https://github.com/Glottography/Rglottography


Report a bug at https://github.com/Glottography/Rglottography/issues


Browse source code at https://github.com/cran/Rglottography


Authors: Peter Ranacher [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, httr2, jsonlite, sf, tibble

Suggests testthat, mockery, knitr, rmarkdown, ggplot2, dplyr, rnaturalearth


See at CRAN