library(sf)
## Linking to GEOS 3.11.2, GDAL 3.6.2, PROJ 9.2.0; sf_use_s2() is TRUE
library(ggplot2)
library(readxl)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.3     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ lubridate 1.9.2     ✔ tibble    3.2.1
## ✔ purrr     1.0.2     ✔ tidyr     1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(patchwork)
library(gapminder)
library(plotly)
## 
## Attaching package: 'plotly'
## 
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## The following object is masked from 'package:graphics':
## 
##     layout
NL <-read_sf ("gadm41_NLD_shp", "gadm41_NLD_2")

ggplot() +
  geom_sf(data = NL) + 
  theme_minimal()

dataNLWorkmap <- read_xlsx("dataNLWorkmap.xlsx")

religionNL <- dataNLWorkmap


StatsNL <- NL %>% 
  left_join(religionNL, 
            by = c("NAME_2" = "Gemeente"))
Catholic <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Katholiek)) +
  scale_fill_gradientn(colours = c("white","slateblue"))+
  labs(fill = "Percentage", title = "Number of Catholic people per Municipality") +
  theme_void()
ggplotly(Catholic) 
Islam <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Islam)) +
  scale_fill_gradientn(colours = c("white", "chartreuse"))+
  labs(fill = "Percentage", title = "Number of Muslims per Municipality")+
  theme_void()
ggplotly(Islam)
Dutch_Ref <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Hervormd)) +
  scale_fill_gradientn(colours = c("white", "firebrick"))+
  labs(fill = "Percentage", title = "Number of Dutch reformed people per Municipality")+
  theme_void()
plotly_build(Dutch_Ref)
Reformed <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Gereformeerd)) +
  scale_fill_gradientn(colours = c("white", "hotpink"))+
  labs(fill = "Percentage", title = "Number of Reformed people per Municipality") +
  theme_void()
plotly_build(Reformed)
PKN <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= PKN)) +
  scale_fill_gradientn(colours = c("white", "darkorchid"))+
  labs(fill = "Percentage", title = "Number of Protestant people per Municipality")+
  theme_void()
plotly_build(PKN)
Jewish <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Joods)) +
  scale_fill_gradientn(colours = c("white", "yellow"))+
  labs(fill = "Percentage", title = "Number of Jewish people per Municipality")+
  theme_void()
plotly_build(Jewish)
Hinduism <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Hindoe)) +
  scale_fill_gradientn(colours = c("white", "violetred"))+
  labs(fill = "Percentage", title = "Number of Hinduist people per Municipality")+
  theme_void()
plotly_build(Hinduism)
Buddhist <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Boeddhist)) +
  scale_fill_gradientn(colours = c("white", "orangered"))+
  labs(fill = "Percentage", title = "Number of Buddist people per Municipality")+
  theme_void()
plotly_build(Buddhist)
Other <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Anders)) +
  scale_fill_gradientn(colours = c("white", "olivedrab"))+
  labs(fill = "Percentage", title = "Number of Other religions per Municipality")+
  theme_void()
plotly_build(Other)