Title: | Offers Various Swiss Maps as Data Frames and 'ggplot2' Objects |
Description: | Offers various swiss maps as data frames and 'ggplot2' objects and gives the possibility to add layers of data on the maps. Data are publicly available from the swiss federal statistical office. In addition to the \code{maps2} object (a list of 8 swiss maps, at various levels), there are the data frames with the boundaries used to produce these maps (\code{shp_df}, a list with 8 data frames). |
Version: | 0.1.2 |
License: | GPL-2 |
URL: | https://github.com/gibonet/ggswissmaps, http://gibonet.github.io/ggswissmaps/ |
Depends: | R (≥ 2.14) |
Imports: | utils, ggplot2 (≥ 2.0.0) |
Suggests: | dplyr, sf, knitr, rmarkdown |
VignetteBuilder: | knitr |
LazyData: | yes |
RoxygenNote: | 7.3.2 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2025-06-23 09:29:23 UTC; gibo |
Author: | Sandro Burri [aut, cre], Eric Stephani [aut], Lisa Bottinelli [ctb] |
Maintainer: | Sandro Burri <gibo.gaf@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-06-23 15:50:10 UTC |
ggswissmaps: Offers Various Swiss Maps as Data Frames and 'ggplot2' Objects
Description
Offers various swiss maps as data frames and 'ggplot2' objects and gives the possibility to add layers of data on the maps. Data are publicly available from the swiss federal statistical office. In addition to the maps2
object (a list of 8 swiss maps, at various levels), there are the data frames with the boundaries used to produce these maps (shp_df
, a list with 8 data frames).
Author(s)
Maintainer: Sandro Burri gibo.gaf@gmail.com
Authors:
Eric Stephani eric.stephani@bluewin.ch
Other contributors:
Lisa Bottinelli lisa.bottinelli@gmail.com [contributor]
See Also
Useful links:
A list with 8 'ggplot2' objects of swiss territory boundaries, at various levels.
Description
Every element of the list is a 'ggplot2' graphic, corresponding to an
element of shp_df
.
Usage
maps2
Format
A list with 8 data frames with swiss territory boundaries (at various levels).
Details
Columns are not all the same across data frames, but usually they have the following in common:
long. Longitude coordinate (x)
lat. Latitude coordinate (y)
group. A factor to be used to plot the polygons correctly (with ggplot2)
Source
https://data.geo.admin.ch/browser/index.html#/collections/ch.bfs.historisierte-administrative_grenzen_g1?.language=en. Download date: 2015-08-18
Examples
class(maps2)
length(maps2)
names(maps2)
# str(maps2[["g1k15"]])
# By name
maps2[["g1k15"]]
# By index
maps2[[5]]
Prepares the base of a map, starting from a data frame with longitude (long) and latitude (lat) coordinates, as a 'ggplot2' object
Description
Prepares the base of a map, starting from a data frame with longitude (long) and latitude (lat) coordinates, as a 'ggplot2' object
Usage
maps2_(
data,
mapping = ggplot2::aes(x = .data[["long"]], y = .data[["lat"]], group =
.data[["group"]]),
caption = "Boundaries: BFS GEOSTAT / swisstopo"
)
Arguments
data |
data frame with longitude, latitude and group coordinates of a territory (polygons) |
mapping |
Aesthetic mappings, as character strings ( |
caption |
text to include in the lower right corner of the map (default: "Boundaries: BFS GEOSTAT / swisstopo") |
Examples
data(shp_df)
maps2_(data = shp_df[[1]])
A list with 8 data frames of swiss territory boundaries, at various levels.
Description
Every element of the list is a data frame, which can be used with 'ggplot2'.
Format
A list with 8 data frames with swiss territory boundaries (at various levels).
Details
Columns are not all the same across data frames, but usually they have the following in common:
long. Longitude coordinate (x)
lat. Latitude coordinate (y)
group. A factor to be used to plot the polygons correctly (with ggplot2)
Source
https://data.geo.admin.ch/browser/index.html#/collections/ch.bfs.historisierte-administrative_grenzen_g1?.language=en. Download date: 2015-08-18
Examples
data(shp_df)
class(shp_df)
length(shp_df)
names(shp_df)
str(shp_df[["g1k15"]])
A list with 8 'sf' objects of swiss territory boundaries, at various levels.
Description
Every element of the list is a 'sf' data frame, which can be used with 'ggplot2'.
Format
A list with 8 'sf' data frames with swiss territory boundaries (at various levels).
Details
Every 'sf' data frame has a column "geometry", which is a list-column containing the boundaries of the polygons.
See the vignette (vignette("ggswissmaps_with_sf", package = "ggswissmaps")
)
for some examples.
Source
https://data.geo.admin.ch/browser/index.html#/collections/ch.bfs.historisierte-administrative_grenzen_g1?.language=en. Download date: 2015-08-18
Examples
data(shp_sf)
class(shp_sf)
length(shp_sf)
names(shp_sf)
str(shp_sf[["g1k15"]])
theme_white_f is a 'ggplot2' theme function that can be added to a 'ggplot2' object to eliminate axes, ticks and put white background
Description
theme_white_f is a 'ggplot2' theme function that can be added to a 'ggplot2' object to eliminate axes, ticks and put white background
Usage
theme_white_f(base_size = 12, base_family = "")
Arguments
base_size |
base font size |
base_family |
base font family |