Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
markus1bauer committed Feb 17, 2022
1 parent 7d0f6eb commit 51e5610
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 165 deletions.
165 changes: 0 additions & 165 deletions .Rhistory
Original file line number Diff line number Diff line change
Expand Up @@ -274,168 +274,3 @@ theme_mb()
### Save ###
ggsave(here("outputs", "figures", "figure_6_cwm_ldmc_800dpi_6x6cm.tiff"),
dpi = 800, width = 6, height = 6, units = "cm")
# Show Figure CWM seed mass ####
# Markus Bauer
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# A Preparation #########################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### Packages ###
library(here)
library(tidyverse)
library(ggbeeswarm)
### Start ###
rm(list = ls())
setwd(here("data", "processed"))
### Load data ###
sites <- read_csv("data_processed_sites.csv", col_names = TRUE,
col_types =
cols(
.default = col_double(),
id = col_factor(),
treatment = col_factor()
)) %>%
select(id, treatment, cwmAbuSeedmass) %>%
mutate(treatment = fct_relevel(treatment, c("no_dam", "behind_dam")),
treatment = fct_recode(treatment,
"Active" = "no_dam",
"Inactive" = "behind_dam"))
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# B Plotten #############################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
theme_mb <- function() {
ggplot2::theme(
panel.background = ggplot2::element_rect(fill = "white"),
text = ggplot2::element_text(size = 10, color = "black"),
axis.line.y = ggplot2::element_line(),
axis.line.x = ggplot2::element_blank(),
axis.ticks.x = ggplot2::element_blank(),
legend.key = ggplot2::element_rect(fill = "white"),
legend.position = "right",
legend.margin = ggplot2::margin(0, 0, 0, 0, "cm"),
plot.margin = ggplot2::margin(.5, 0, 0, 0, "cm")
)
}
ggplot(sites, aes(treatment, cwmAbuSeedmass)) +
geom_boxplot(colour = "black") +
geom_quasirandom(color = "black", dodge.width = .6, size = .8) +
scale_y_continuous(limits = c(1, 3), breaks = seq(0, 100, .5)) +
labs(x = "", y = "CWM seed mass [mg]", size = 3) +
theme_mb()
### Save ###
ggsave(here("outputs", "figures", "figure_6_cwm_seedmass_800dpi_6x6cm.tiff"),
dpi = 800, width = 6, height = 6, units = "cm")
# Show map of the Schnalz floodplain ####
# Markus Bauer
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# A Preparation #########################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### Packages ###
library(here)
library(tidyverse)
library(sf)
library(ggmap)
library(ggrepel)
library(RColorBrewer)
library(patchwork)
### Start ###
rm(list = ls())
setwd(here("data", "processed", "spatial"))
### Load data ###
ger <- st_read("germany.shp")
weir <- st_read("weir")
sites <- st_read("sites.shp")
sites2 <- read_csv("sites2.csv", col_names = TRUE,
col_types =
cols(
id = col_factor(),
Floodplain = col_factor()
))
load("background_toner.rda")
load("background_terrain.rda")
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# B Plot ################################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
theme_mb <- function() {
ggplot2::theme(
panel.background = ggplot2::element_rect(fill = NA),
panel.grid = ggplot2::element_line(colour = NA),
text = ggplot2::element_text(size = 10, color = "black"),
axis.title = ggplot2::element_blank(),
axis.text = ggplot2::element_blank(),
axis.ticks = ggplot2::element_blank(),
axis.line.x = ggplot2::element_blank(),
axis.line.y = ggplot2::element_blank(),
legend.position = "none",
plot.margin = ggplot2::margin(.5, 0, 0, 0, "cm")
)
}
## 1 Preparation ########################################################
### a Map of project site -----------------------------------------------
(sites_graph <- ggmap(background_terrain) +
geom_point(data = sites2, aes(x = lon, y = lat, shape = Floodplain),
size = 2, color = "black") +
geom_point(aes(x = 10.9595, y = 47.77385),
pch = 15, size = 2, color = "black") +
annotate("text", x = 10.9595, y = 47.7736,
label = "Weir", size = 3) +
coord_sf(crs = st_crs(4326)) +
annotate("text", x = 10.9553, y = 47.7743,
label = "Inactive floodplain", size = 3) +
annotate("text", x = 10.9652, y = 47.77475,
label = "Active floodplain", size = 3) +
ggspatial::annotation_scale(location = "br",
pad_y = unit(0.6, "cm"),
pad_x = unit(0.7, "cm"),
width_hint = 0.4,
height = unit(0.2, "cm")) +
ggspatial::annotation_north_arrow(location = "br",
pad_y = unit(1.1, "cm"),
pad_x = unit(0.6, "cm"),
which_north = "true",
style = ggspatial::north_arrow_fancy_orienteering(),
height = unit(1, "cm"),
width = unit(1, "cm")) +
theme_mb())
### b Germany -----------------------------------------------------------
ger_graph <- ggplot() +
geom_sf(data = ger, fill = "transparent", colour = "black") +
geom_point(aes(x = 10.95948, y = 47.77405), size = 1, colour = "white") +
theme_mb() +
theme(
plot.background = element_blank()
)
### c Inset --------------------------------------------------------------
sites_graph + inset_element(ger_graph, .01, .65, .3, .99, on_top = TRUE)
# 2 Save #################################################################
ggsave("figure_1_map_300dpi_12x10cm.tiff",
dpi = 300, width = 12, height = 10, units = "cm",
path = here("outputs", "figures"))
# Show Figure FDis of all three traits ####
# Markus Bauer
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# A Preparation #########################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
### Packages ###
library(here)
library(tidyverse)
library(ggbeeswarm)
### Start ###
rm(list = ls())
setwd(here("data", "processed"))
### Load data ###
sites <- read_csv("data_processed_sites.csv", col_names = TRUE,
col_types =
cols(
.default = col_double(),
id = col_factor(),
treatment = col_factor()
)) %>%
select(id, treatment, fdisAbuLHS) %>%
mutate(treatment = fct_relevel(treatment, c("no_dam", "behind_dam")),
treatment = fct_recode(treatment,
"Active" = "no_dam",
"Inactive" = "behind_dam"))
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# B Plotten #############################################################
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
theme_mb <- function() {
File renamed without changes.

0 comments on commit 51e5610

Please sign in to comment.