File:Zagoskin lake pollen 1.svg
Original file (SVG file, nominally 720 × 900 pixels, file size: 197 KB)
Captions
Summary[edit]
DescriptionZagoskin lake pollen 1.svg |
English: Pollen diagram of Zagoskin Lake, Alaska, East Beringia |
Date | |
Source | Own work |
Author | Merikanto |
This pollen diagram is based on data in Neotoma.
- Pollen diagram, arranged by pollen %
- "R" script, uses neotoma, rioja, ...
- 25.10.2021 0000.0007
-
- Original code is
-
- "Making a pollen diagram from Neotoma", Richard Telford’s Blog
-
-
- load packages
library("tidyverse")
library("neotoma")
library("rioja")
- devtools::install_github("richardjtelford/ggpalaeo") #NEW VERSION
library("ggpalaeo") #Need new version
library("stringr")
- load by sitename. if this fails, try by dataset id!
by_sitename=1
by_dataset_id=0
- drawing style
draw_by_age=1
draw_by_depth=0
draw_by_depth_without_age=0
- minimum pollen count %
count_percent_limit1=3
top_margin=0.8
- sitename1<-"Mammoth Dima site"
- dataset_id=692
sitename1<-'Zagoskin Lake'
- sitename1<-'Puyuk Lake'
- sitename1<-"Plesheevo lake"
- dataset_id=4396
- sitename1<-"Lake Nero"
- dataset_id=4303
- sitename1<-"Bugutak"
- sitename1<-"Bludlivaya River"
- sitename1<-"Byllatskoye Exposure"
- sitename1<-"Smorodinovoye Lake"
- sitename1<-"Lake Billyakh"
- sitename1<-"Ledovyi Obryv Exposure, Northern Section"
- dataset_id=1688
- sitename1<-"Alut Lake"
- sitename1<-"Mamontovy Khataya IC"
- sitename1<-'Zagoskin Lake'
- count_percent_limit1=5
- sitename1<-'Elikchan 4 Lake'
- count_percent_limit1=3
- sitename1<-"Tanneurs"
- sitename1<-"Marais de la Poupiniere" #NOK
- sitename1<-'Bois des Gardes'
- dataset_id=22759
- sitename1<-'La Chaumette'
- dataset_id=22759
- sitename1<-'Lake Gosciaz'
- dataset_id=42510
- sitename1<-'Meerfelder Maar'
- puyuk lake
- dataset_id=1987 ## if you download by site name, this is overridden
- berelekh
- dataset_id=3063
- sitename1<-'Berelyekh River, Indigirka Lowland'
- sitename1<-'Meerfelder Maar'
- count_percent_limit1=10
- sitename1="BER2IND"
count_percent_limit1=5
sitename_x0=tolower(sitename1)
sitename_x1<-str_replace(sitename_x0,' ', '_')
outfilename1<-paste0("./",sitename_x1,"_pollen_n.svg")
if(by_sitename==1)
{
print("By sitename ...")
site1 <- get_site(sitename = paste0(sitename1,'%'))
site1_pollen=get_dataset(site1)
site1_data0=get_download(site1_pollen)
#str(site1)
#str(site1_pollen)
#str(site1_data0)
#str(site1_data01)
#str(site1_data2)
#dataset_indexi=1
#site1_data=site1_data01
site1_data<-site1_data0
#stop(-1)
#print (str(site1))
print (str(site1_pollen))
bambili_raw<-site1_data
#str(bambili_raw)
sq1<-site1_pollen2
sq2<-sq1[2]
sq3<-sq2[1]
sq4<-sq3[1]
sq5<-sq4[1]
sq6<-sq51
sq7<-as.data.frame(sq6['dataset.id'])
sxx1<-sq7['dataset.id']
sxx2<-as.character(sxx1)
site_id1<-as.integer(sxx2)
site_id1
site_id_char1<-as.character(site_id1)
bambili_raw <- site1_data
}
if(by_dataset_id==1)
{
print("By dataset ID ...")
ds1<-get_dataset(dataset_id)#check correct site
print(ds1)
bambili_raw <- get_download(dataset_id)
}
eco_types <- get_table("EcolGroupTypes")
- by site number:
- bambili_raw <- get_download(17391)
str(bambili_raw)
tabula0<-bambili_raw1
- str(tabula0)
cnts<-counts(tabula0) #
meta = tabula0$sample.meta #sample depths/ages
taxa0 = tabula0$taxon.list
taxa = taxa0 %>%
mutate_all(as.character)
bambili <- meta %>% select(age, depth) %>%
bind_cols(cnts) %>%
pivot_longer(cols = -c("age", "depth"), names_to = "species", values_to = "count") %>%
left_join(taxa, by = c("species" = "taxon.name"))
bambili %>% count(variable.element)
eco_types %>%
semi_join(bambili, by = c("EcolGroupID" = "ecological.group")) %>%
select(EcolGroupID, EcolGroup)
str(eco_types)
bambili %>% filter(ecological.group == "SEED", count > 0) %>%
select(species, count) %>%
group_by(species) %>%
summarise(n = n(), max = max(count))
- old: filter unwanted groups out
- bambili = bambili %>%
- filter(!ecological.group %in% c("AQVP", "UNID", "SEED"))
- use `%in%` not `==`
- check count sums
bambili %>%
group_by(depth) %>%
summarise(s = sum(count)) %>%
arrange(s) %>%
slice(1:5)
- calculate percent
bambili = bambili %>%
group_by(depth) %>%
mutate(percent = count/sum(count) * 100)
- remove rare taxa
bambili1 = bambili %>%
group_by(species) %>%
filter(
sum(percent > 0) >= count_percent_limit1, #must be in at least three samples
max(percent) > count_percent_limit1) #must have a max percent > 3
bambili2 <- bambili1 %>%
select(age, depth, species, percent) %>%
pivot_wider(names_from = "species", values_from = "percent")
bambili_spp <- bambili2 %>% select(-age, -depth) %>%
as.data.frame()#
bambili2 <- bambili1 %>%
mutate(
- make ecological.group a factor with TRSH first
- ecological.group = factor(ecological.group, levels = c("TRSH", "UPHE", "VACR","AQVP", "AQBR","ALGA")),
- ecological.group = factor(ecological.group, levels = c("TRSH","UPHE","AQVP","VACR","AQBR","FUNGI","ALGA","FUNG","AMOE","TARD")),
ecological.group = factor(ecological.group, levels = c("TRSH", "UPHE", "VACR", "AQBR", "AQVP", "TARD", "ALGA")),
mean_percent = mean(percent)) %>%
- arrange by ecological.group and mean_percent (largest first)
arrange(ecological.group, desc(mean_percent)) %>%
ungroup() %>%
- make species into a factor so we can perserve the order
mutate(species = factor(species, levels = unique(species)))
- reshape using tidyr::spread as pivot_wider (currently?) ignores factor order
bambili3 <- bambili2 %>%
select(age, depth, species, percent) %>%
spread(key = "species", value = "percent")
bambili_spp <- bambili3 %>%
select(-age, -depth) %>%
as.data.frame(bambili_spp)
- set up for ecological group colours
ecological_groups <- bambili2 %>%
distinct(species, ecological.group) %>%
pull(ecological.group)
- ecological_colours <- c("red", "green", "orange")
ecological_colours <- c("forestgreen", "orange", "red", "violet", "blue", "darkblue","darkviolet")
- jn warning
bambili2_spp <- bambili2 %>%
select(-age, -depth) %>%
as.data.frame(bambili_spp)
- stop(-1)
bambili_dist <- dist(sqrt(bambili_spp/100))#chord distance
clust <- chclust(bambili_dist, method = "coniss")
- bstick(clust)#five groups
if(draw_by_age==1)
{
svg(filename=outfilename1, width=8, height=10, pointsize=16)
- set up mgp (see ?par)
mgp <- c(2, 0.25, 0)
par(tcl = -0.15, mgp = mgp)#shorter axis ticks - see ?par
pt <- strat.plot(
title=sitename1,
cex.title=1.5,
d = bambili_spp,
- yvar = bambili3$depth,
yvar = bambili3$age,
y.rev = TRUE, #reverse direction of y-axis
scale.percent = TRUE, #use constant scale for all taxa
srt.xlabel = 90, #rotate x-label by 45 degrees
cex.xlabel = 0.8, #smaller font
mgp = mgp,
xRight = 0.98, #right margin
xLeft = 0.21, #left margin with space for 2nd axis
yTop = top_margin, #top margin
yBottom = 0.1, #bottom margin
plot.line=FALSE, plot.poly=TRUE, plot.bar=FALSE,
col.line = ecological_colours[ecological_groups],#colours
col.poly = ecological_colours[ecological_groups], #colours
col.poly.line = ecological_colours[ecological_groups], #colours
col.bar = ecological_colours[ecological_groups], #colours
lwd.poly=1,
ylabel = "Date yr BP",
clust = clust
)
- add zone boundaries
addClustZone(pt, clust = clust, nZone = 5)
- add a secondary scale
secondary_scale(pt, yvar = bambili3$age,
yvar2 = bambili3$depth,
ylabel2 = "Depth m",
n = 10)
dev.off()
}
if(draw_by_depth==1)
{
svg(filename=outfilename1, width=8, height=10, pointsize=16)
- set up mgp (see ?par)
mgp <- c(2, 0.25, 0)
par(tcl = -0.15, mgp = mgp)#shorter axis ticks - see ?par
pt <- strat.plot(
title=sitename1,
cex.title=1.5,
d = bambili_spp,
yvar = bambili3$depth,
- yvar = bambili3$age,
y.rev = TRUE, #reverse direction of y-axis
scale.percent = TRUE, #use constant scale for all taxa
srt.xlabel = 90, #rotate x-label by 45 degrees
cex.xlabel = 0.8, #smaller font
mgp = mgp,
xRight = 0.98, #right margin
xLeft = 0.21, #left margin with space for 2nd axis
yTop = top_margin, #top margin
yBottom = 0.1, #bottom margin
plot.line=FALSE, plot.poly=TRUE, plot.bar=FALSE,
col.line = ecological_colours[ecological_groups],#colours
col.poly = ecological_colours[ecological_groups], #colours
col.poly.line = ecological_colours[ecological_groups], #colours
col.bar = ecological_colours[ecological_groups], #colours
lwd.poly=1,
ylabel = "Depth m",
clust = clust
)
- add zone boundaries
addClustZone(pt, clust = clust, nZone = 5)
- add a secondary scale
secondary_scale(pt, yvar = bambili3$depth,
yvar2 = bambili3$age,
ylabel2 = "Age BP",
n = 10)
dev.off()
}
if(draw_by_depth_without_age==1)
{
svg(filename=outfilename1, width=8, height=10, pointsize=16)
- set up mgp (see ?par)
mgp <- c(2, 0.25, 0)
par(tcl = -0.15, mgp = mgp)#shorter axis ticks - see ?par
pt <- strat.plot(
title=sitename1,
cex.title=1.5,
d = bambili_spp,
yvar = bambili3$depth,
- yvar = bambili3$age,
y.rev = TRUE, #reverse direction of y-axis
scale.percent = TRUE, #use constant scale for all taxa
srt.xlabel = 90, #rotate x-label by 45 degrees
cex.xlabel = 0.8, #smaller font
mgp = mgp,
xRight = 0.98, #right margin
xLeft = 0.21, #left margin with space for 2nd axis
yTop = top_margin, #top margin
yBottom = 0.1, #bottom margin
plot.line=FALSE, plot.poly=TRUE, plot.bar=FALSE,
col.line = ecological_colours[ecological_groups],#colours
col.poly = ecological_colours[ecological_groups], #colours
col.poly.line = ecological_colours[ecological_groups], #colours
col.bar = ecological_colours[ecological_groups], #colours
lwd.poly=1,
ylabel = "Depth m",
clust = clust
)
- add zone boundaries
addClustZone(pt, clust = clust, nZone = 5)
- add a secondary scale
- secondary_scale(pt, yvar = bambili3$depth,
- yvar2 = bambili3$age,
- ylabel2 = "Age BP",
- n = 10)
dev.off()
}
print(".")
Licensing[edit]
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 08:22, 25 October 2021 | 720 × 900 (197 KB) | Merikanto (talk | contribs) | Update | |
14:03, 24 October 2021 | 720 × 900 (198 KB) | Merikanto (talk | contribs) | updeate | ||
14:00, 24 October 2021 | 720 × 900 (133 KB) | Merikanto (talk | contribs) | update | ||
12:36, 24 October 2021 | 720 × 900 (198 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 576pt |
---|---|
Height | 720pt |