#' Import Data from year 2018
#'
#' @param x parameter needs to be left empty
#'
#' @return Returns a spatial features point object containing all accidents available from Destatis
#' @export
#'
#'@importFrom sf read_sf
#' @importFrom sf st_as_sf
#' @importFrom sf st_transform
#' @importFrom stats setNames
#' @importFrom utils download.file
#' @importFrom utils unzip
#'
import_2018 <- function(x) {
temp <- tempfile()
download.file(
"https://unfallatlas.statistikportal.de/app/UnfalldatenDownload/Unfallorte2018_LinRef_Shapefile.zip",
temp
)
unzip(temp)
y_18 <-
read_sf("./Shapefile/Unfallorte2018_LinRef.shp",
"Unfallorte2018_LinRef")
y_18 <- st_as_sf(y_18)
y_18 <- st_transform(y_18, 25832)
return(y_18)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.