Skip to contents

Mirror of Python's morie.tps_io.load_tps. csv and excel work with base R / readxl; all spatial formats (geojson, featurecollection, kml, geopackage, sqlitegeodatabase, shapefile, filegeodatabase) are gated behind requireNamespace("sf") and surface a clean install message if the dependency is missing.

Usage

morie_tps_load(name, format = "csv", nrows = NULL)

Arguments

name

TPS category. Case-insensitive.

format

One of MORIE_TPS_SUPPORTED_FORMATS.

nrows

Optional integer cap on rows.

Value

A data.frame (spatial readers return the dropped-sf data frame; geometry column is preserved as an sfc).

Examples

# \donttest{
# Reads from the local TPS cache dir (populate via morie_tps_fetch_category):
df <- morie_tps_load("Assault", format = "csv", nrows = 100L)
#> morie_tps: no local TPS cache for 'Assault'; using the bundled sample from rmoriedata. Fetch the full export with morie_tps_fetch_category().
# }