library(sf)
## Linking to GEOS 3.11.2, GDAL 3.6.2, PROJ 9.2.0; sf_use_s2() is TRUE
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.2
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", "red"))+
  labs(fill = "Percentage", title = "Percentage of Catholics per Municipality", subtitle = "In this map, it is clear that the majority of Catholics live in the south of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  theme_void()
ggplotly(Catholic)
Islam <- ggplot(data=StatsNL) + 
  geom_sf(aes(fill= Islam)) +
  scale_fill_gradientn(colours = c("white", "chartreuse"))+
  labs(fill = "Percentage", title = "Percentage of Muslims per Municipality", subtitle = "In this map, it is clear that the majority of Muslims live in the west of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Dutch reformed people per Municipality", subtitle = "In this map, it is clear that the majority of Dutch reformed people live in the east of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Reformed people per Municipality", subtitle = "In this map, it is clear that the majority of Reformed people live in the east of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek") +
  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 = "Percentage of Protestant people per Municipality", subtitle = "In this map, it is clear that the majority of Protestant people live in the Northeast and Southwest of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Jewish people per Municipality", , subtitle = "In this map, it is clear that the majority of Jewish people live in the west of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Hinduist people per Municipality", subtitle = "In this map, it is clear that the majority of Hinduist people live in the west of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Buddist people per Municipality", subtitle = "In this map, it is clear that the majority of Buddists live in the west of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  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 = "Percentage of Other religions per Municipality", subtitle = "In this map, it is clear that the majority of Other religions live in the center of the Netherlands", caption = "Data from Centraal Bureau voor de Statistiek")+
  theme_void()
plotly_build(Other)