Locate a Bundled Example Asset
example_file.RdReturn the local path to a bundled boundary, illustration, metadata file or data table.
Details
Assets live in the installed package extdata directory. Examples include
world_sf.geojsonandeurope_sf.geojsonboundaries.The
florence.svgschematic illustration.WORLD-NOTICE.txtandFLORENCE-NOTICE.txtsource notices.
Metadata JSON files record source preparation and attribution. Paths refer to local files; no download is performed.
Read boundaries with sf::st_read.
Use set_background for illustrations.
Read CSV tables with example_data.
Complete runnable scripts live separately in the installed examples directory;
locate them with
system.file("examples", "gdp.R", package = "offlineatlas")Do not write into the installed package directory.
See also
example_data, add_areas, set_background.
For the tutorial, see the offlineatlas package overview.
Examples
path <- example_file("world_sf.geojson")
stopifnot(file.exists(path))