Skip to content

Commit

Permalink
Depositional environment: Clean original names, remove duplicates, up…
Browse files Browse the repository at this point in the history
…date figures (#10)
  • Loading branch information
OndrejMottl authored Aug 7, 2024
1 parent 5943904 commit 58248eb
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 87 deletions.
Binary file modified Outputs/Figures/Figure_04.pdf
Binary file not shown.
Binary file modified Outputs/Figures/Figure_A03.pdf
Binary file not shown.
Binary file modified Outputs/Figures/Figure_A03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 28 additions & 38 deletions Outputs/Tables/Table_S1.csv
Original file line number Diff line number Diff line change
@@ -1,44 +1,34 @@
Original depositional environment,Depositional environment - broader grouping
Lacustrine Beach,Coastal
coastal,Coastal
"coastal, estuarine",Coastal
"lacustrine, playa",Coastal
Coastal,Coastal
"Coastal, estuarine",Coastal
Lacustrine beach,Coastal
"Lacustrine, playa",Coastal
Fluvial,Fluvial
Moraine Dammed Lake,Fluvial
fluvial,Fluvial
Moraine dammed lake,Fluvial
Glacial,Glacial
Cirque Lake,Lacustrine
Drained Lake,Lacustrine
Explosion Crater Lake,Lacustrine
Glacial Origin Lake,Lacustrine
Interdunal Lake,Lacustrine
Cirque lake,Lacustrine
Drained lake,Lacustrine
Explosion crater lake,Lacustrine
Glacial origin lake,Lacustrine
Interdunal lake,Lacustrine
Lacustrine,Lacustrine
Lava Flow Dammed Lake,Lacustrine
Natural Lake,Lacustrine
Natural Lake (Origin Unknown),Lacustrine
Small Hollow,Lacustrine
Solution Origin Lake,Lacustrine
Spring Mound,Lacustrine
Wind Origin Lake,Lacustrine
lacustrine,Lacustrine
"lacustrine, drained lake",Lacustrine
"lacustrine, natural open-water",Lacustrine
"lacustrine, natural open-water, glacial origin",Lacustrine
"lacustrine, natural open-water, tectonic lake",Lacustrine
"lacustrine, volcanic lake",Lacustrine
marine,Marine
"Lacustrine, natural open-water",Lacustrine
"Lacustrine, natural open-water, tectonic lake",Lacustrine
"Lacustrine, volcanic lake",Lacustrine
Lava flow dammed lake,Lacustrine
Small hollow,Lacustrine
Solution origin lake,Lacustrine
Spring mound,Lacustrine
Wind origin lake,Lacustrine
Marine,Marine
Archaeological,Terrestrial
terrestrial,Terrestrial
"terrestrial, cave sediments",Terrestrial
"terrestrial, soil, buried soil",Terrestrial
Fen,Wetlands
Mire,Wetlands
Swamp,Wetlands
Valley Mire,Wetlands
"terrestrial, mire (i.e. peatland, >30cm peat)",Wetlands
"terrestrial, mire, bog",Wetlands
"terrestrial, mire, bog, blanket bog",Wetlands
"terrestrial, mire, fen",Wetlands
"terrestrial, mire,swamp (forested wetland or peatland)",Wetlands
Terrestrial,Terrestrial
"Terrestrial, cave sediments",Terrestrial
"Terrestrial, soil, buried soil",Terrestrial
"Terrestrial, mire",Wetlands
"Terrestrial, mire, bog",Wetlands
"Terrestrial, mire, bog, blanket bog",Wetlands
"Terrestrial, mire, fen",Wetlands
"Terrestrial, mire, swamp",Wetlands
Valley mire,Wetlands
Unknown,Unknown
NA,Unknown
114 changes: 65 additions & 49 deletions R/03_Depositional_environments.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ if (
dplyr::glimpse(data_ippd)
}

#----------------------------------------------------------#
# 3. Remove duplicated environements -----
#----------------------------------------------------------#

data_ippd_depenv_presort <-
data_ippd %>%
dplyr::mutate(
depositionalenvironment = stringr::str_to_sentence(depositionalenvironment)
) %>%
dplyr::mutate(
depositionalenvironment_clean = dplyr::case_when(
.default = depositionalenvironment,
depositionalenvironment == "Fen" ~ "Terrestrial, mire, fen",
depositionalenvironment == "Lacustrine, drained lake" ~ "Drained lake",
depositionalenvironment == "Lacustrine, natural open-water, glacial origin" ~ "Glacial origin lake",
depositionalenvironment == "Mire" ~ "Terrestrial, mire",
depositionalenvironment == "Natural lake" ~ "Lacustrine, natural open-water",
depositionalenvironment == "Natural lake (origin unknown)" ~ "Lacustrine, natural open-water",
depositionalenvironment == "Swamp" ~ "Terrestrial, mire, swamp",
depositionalenvironment == "Terrestrial, mire (i.e. peatland, >30cm peat)" ~ "Terrestrial, mire",
depositionalenvironment == "Terrestrial, mire,swamp (forested wetland or peatland)" ~ "Terrestrial, mire, swamp",
is.na(depositionalenvironment) ~ "Unknown"
)
)

#----------------------------------------------------------#
# 3. Harmonise environemnts -----
Expand Down Expand Up @@ -69,58 +93,50 @@ if (
}

data_ippd_depenv_harmonised <-
data_ippd %>%
data_ippd_depenv_presort %>%
dplyr::mutate(
depenv_harmonised = dplyr::case_when(
.default = depositionalenvironment,
depositionalenvironment %in% c(
"Valley Mire",
"Swamp",
"Mire",
"terrestrial, mire, bog,\tblanket bog",
"terrestrial, mire, bog",
"terrestrial, mire (i.e. peatland, >30cm peat)",
"terrestrial, mire,swamp (forested wetland or peatland)",
"terrestrial, mire, fen",
"Fen"
.default = depositionalenvironment_clean,
depositionalenvironment_clean %in% c(
"Valley mire",
"Terrestrial, mire, bog,\tblanket bog",
"Terrestrial, mire, bog",
"Terrestrial, mire",
"Terrestrial, mire, swamp",
"Terrestrial, mire, fen"
) ~ "Wetlands",
depositionalenvironment %in% c(
"Cirque Lake",
"Explosion Crater Lake",
"Glacial Origin Lake",
"Wind Origin Lake",
"Interdunal Lake",
"Natural Lake (Origin Unknown)",
"Lava Flow Dammed Lake",
"Drained Lake",
"Natural Lake",
"lacustrine, volcanic lake",
"lacustrine, natural open-water, tectonic lake",
"lacustrine, natural open-water, glacial origin",
"lacustrine, drained lake",
"Spring Mound",
"Small Hollow",
"Solution Origin Lake",
"lacustrine",
"lacustrine, natural open-water"
depositionalenvironment_clean %in% c(
"Cirque lake",
"Explosion crater lake",
"Glacial origin lake",
"Wind origin lake",
"Interdunal lake",
"Lava flow dammed lake",
"Drained lake",
"Lacustrine, volcanic lake",
"Lacustrine, natural open-water, tectonic lake",
"Spring mound",
"Small hollow",
"Solution origin lake",
"Lacustrine",
"Lacustrine, natural open-water"
) ~ "Lacustrine",
depositionalenvironment %in% c(
"Archaeological", "terrestrial, soil, buried soil",
"terrestrial, cave sediments",
"terrestrial"
depositionalenvironment_clean %in% c(
"Archaeological",
"Terrestrial, soil, buried soil",
"Terrestrial, cave sediments",
"Terrestrial"
) ~ "Terrestrial",
depositionalenvironment %in% c(
"Fluvial", "Moraine Dammed Lake",
"fluvial"
depositionalenvironment_clean %in% c(
"Fluvial",
"Moraine dammed lake"
) ~ "Fluvial",
depositionalenvironment %in% c(
"Lacustrine Beach",
"coastal, estuarine",
"lacustrine, playa",
"coastal"
) ~ "Coastal",
depositionalenvironment == "marine" ~ "Marine",
is.na(depositionalenvironment) ~ "Unknown"
depositionalenvironment_clean %in% c(
"Lacustrine beach",
"Coastal, estuarine",
"Lacustrine, playa",
"Coastal"
) ~ "Coastal"
)
) %>%
dplyr::mutate(
Expand All @@ -132,7 +148,7 @@ data_ippd_depenv_harmonised <-

data_ippd_depenv_harmonised_overview <-
data_ippd_depenv_harmonised %>%
dplyr::distinct(depositionalenvironment, depenv_harmonised)
dplyr::distinct(depositionalenvironment_clean, depenv_harmonised)

assertthat::assert_that(
data_ippd_depenv_harmonised_overview %>%
Expand Down Expand Up @@ -200,7 +216,7 @@ p_dep_env_main <-
p_dep_env_bar_full <-
plot_data_barplot(
data = data_ippd_depenv_harmonised,
var_x = "depositionalenvironment",
var_x = "depositionalenvironment_clean",
var_fill = "depenv_harmonised",
y_axis_limits = c(0, 50),
x_label_angle = 90,
Expand Down Expand Up @@ -306,7 +322,7 @@ purrr::walk(
)

data_ippd_depenv_harmonised_overview %>%
dplyr::arrange(depenv_harmonised, depositionalenvironment) %>%
dplyr::arrange(depenv_harmonised, depositionalenvironment_clean) %>%
rlang::set_names(
nm = c(
"Original depositional environment",
Expand Down

0 comments on commit 58248eb

Please sign in to comment.