if (!require("devtools")) install.packages("devtools")
devtools::install_github("nrkoehler/leipzigr")
This R
package provides some functions I frequently use. That is:
bonferroni
: Bonferroni correction for multiple testing.col_wheel
: Print colour wheel (Source).format_pval
: Format p-values in tables (Source).has_data
: Check whether variables in data frame have values other than NA
(Source).Moreover, it contains datasets providing geospatial data of the German city of Leipzig. Leipzig is divided into 10 greater adminsitrative districts ("Stadtbezirke") and 63 smaller local districts ("Ortsteile"). The names of both smaller and greater districts can be found under the following link. With the data frames shape.bezirke
and shape.ortsteile
the package contains data to plot the boundaries of both greater adminsitrative and smaller local districts.
The data frame shape.bezirke
contains 10.979 observations and 4 variables. That is:
order
: running number,group
: names of the 10 greater administrative districts,lon
: longitude,lat
: latitude.The data frame shape.ortsteile
contains 20.822 observations and 4 variables. That is:
order
: running number,group
: IDs of the 63 smaller local districts,lon
: longitude,lat
: latitude.library(ggplot2)
library(leipzigr)
ggplot(aes(x = lon, y = lat), data = shape.ortsteile) + theme_void() + coord_quickmap() +
geom_polygon(aes(x = lon, y = lat, group = group), fill = NA, size = 0.2,
color = "grey") + geom_polygon(aes(x = lon, y = lat, group = group),
color = "black", size = 1, fill = NA, data = shape.bezirke) + labs(title = "Map of Leipzig",
caption = "Boundaries of greater administrative and smaller local districts.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.