
Last chance! 50% off unlimited learning
Sale ends in
LoadMap
directly looks up the path of a map based on a shortcut name or number, loads the map from this location and return the object.
RequireMap
does the same, but if the map has been loaded before, it returns the temporarily cached copy. The reason for this is that loading the map objects appears to be computationally intensive. It takes relatively long and should not have to be done every time we need a map.
RequireMap(name_x, verbose = FALSE)LoadMap(name_x, basedir = getOption("bfsMaps.base",
default = file.path(find.package("bfsMaps"), "extdata")))
the map object
the name of a map, currently supported are "kant.map"
, "bezk.map"
, "polg.map"
, "greg.map"
, "ch.map"
or any number referring to a row in the 'maps.csv' file.
the function will return the result invisibly, unless verbose is set to TRUE
.
the root directory for the maps to reside. bfsMaps by default looks for the mapfiles in it's install location in the extdata directory. The basedir
can be set as an option too.
Andri Signorell <andri@signorell.net>
The maps are loaded to the package's environment as soon as they are used the first time in the session. Later access is so made considerably faster.
try( {
# use map containing Swiss metropolitan regions
mymap <- RequireMap(78)
plot(mymap, col=Pal("Helsana"))
})
Run the code above in your browser using DataLab