Skip to contents

Loads a dictionary from local storage. If the dictionary is not found locally and auto_download is TRUE (the default), it will be automatically downloaded from the GitLab repository.

Usage

load_dictionary(
  name,
  format = c("qs2", "rda"),
  auto_download = TRUE,
  path = NULL
)

Arguments

name

Dictionary name (e.g., "global_surnames").

format

Preferred file format: "qs2" (default, smaller and faster) or "rda". If preferred format is not available, will try the other.

auto_download

Automatically download if not found locally? Default TRUE.

path

Custom path to look for dictionaries. If NULL, uses package data directories. Default NULL.

Value

A data frame containing the dictionary data.

Examples

if (FALSE) { # \dontrun{
# Load a dictionary (auto-downloads if needed)
data <- load_dictionary("global_surnames")

# Load with specific format
data <- load_dictionary("english_freqs", format = "rda")

# Check if downloaded, don't auto-download
data <- load_dictionary("organisms", auto_download = FALSE)

# Load from custom directory
data <- load_dictionary("my_dict", path = "/my/data")
} # }