format_coordinates: Format coordinates as a readable string

View source: R/coordinates.R

format_coordinatesR Documentation

Format coordinates as a readable string

Description

Create a concise latitude/longitude label (e.g., 48.5^\circ N, 9.1^\circ E) from a two element coordinate vector.

Usage

format_coordinates(coordinates, digits = 1)

Arguments

coordinates

A numeric vector of length two with latitude as the first element and longitude as the second element.

digits

Integerish scalar defining the number of decimal places used for rounding. Defaults to one decimal place.

Value

A character scalar with the formatted coordinate string.

Examples

# Coordinates for Tuebingen, Germany
format_coordinates(c(48.5216, 9.0576))


LightLogR documentation built on Nov. 28, 2025, 5:09 p.m.