Skip to contents

Return the local path to a bundled boundary, illustration, metadata file or data table.

Usage

example_file(name)

Arguments

name

Exact bundled filename, including its extension. Missing files produce an error.

Details

Assets live in the installed package extdata directory. Examples include

  • world_sf.geojson and europe_sf.geojson boundaries.

  • The florence.svg schematic illustration.

  • WORLD-NOTICE.txt and FLORENCE-NOTICE.txt source 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.

Value

A local filename as a character string.

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))