Hi everyone,
I'm getting lost in all the possibilities where I don't know why none of them works. I'm trying to put the calendar dates of my (sub)fossil samples as tick marks for the x axis in a table but can't seem to manage. The beetle data only has 18 samples but the pollen data around 80, is there also a possibility to not have to manually enter each of the calendar dates?
Secondly, at the end I was wondering if both graphs could be combined into one (provided that I can manually adjust the scales as the pollen has far more data points and goes further back in time than the beetles, and give the data points of beetles a different color).
Pollen <- tibble::tribble(
~V1, ~V2, ~V3, ~V4, ~V5, ~V6, ~V7, ~V8, ~V9, ~V10, ~V11, ~V12, ~V13, ~V14,
"Sample name", 2004, 1992, 1980, 1969, 1957, 1946, 1934, 1923, 1911, 1899, 1888, 1876, 1864,
"Abies", 2, 0, 1, 2, 0, 3, 2, 9, 4, 6, 4, 2, 1,
"Acer", 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,
"Alnus", 7, 34, 22, 8, 7, 7, 18, 15, 6, 9, 15, 4, 8,
"Alnus viridis", 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
"Betula", 42, 68, 32, 14, 12, 22, 20, 21, 20, 15, 16, 14, 20,
"Carpinus", 3, 10, 6, 1, 2, 0, 3, 3, 0, 3, 2, 1, 2,
"Corylus", 14, 11, 4, 1, 1, 7, 5, 10, 4, 6, 3, 9, 7,
"Fagus", 27, 14, 13, 2, 2, 6, 5, 6, 15, 4, 7, 8, 11,
"Fraxinus", 0, 3, 3, 1, 2, 2, 1, 0, 0, 0, 0, 0, 0,
"Juniperus", 55, 1, 0, 1, 2, 6, 12, 3, 12, 17, 9, 13, 13,
"Larix", 1, 1, 1, 1, 0, 0, 3, 1, 1, 1, 1, 1, 1,
"Picea", 114, 148, 107, 196, 209, 153, 77, 85, 110, 128, 188, 140, 222,
"Pinus", 129, 226, 562, 257, 169, 167, 161, 168, 119, 105, 145, 114, 175,
"Quercus", 29, 3, 18, 4, 3, 2, 6, 9, 11, 12, 17, 8, 16,
"Salix", 3, 2, 5, 0, 3, 2, 3, 1, 1, 4, 0, 1, 0,
"Sorbus", 1, 1, 1, 2, 2, 0, 0, 0, 1, 0, 0, 0, 1,
"Tilia", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
"Ulmus", 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
"Populus", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
"Juglans", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
)
Beetles <- tibble::tribble(
~SpeciesName, 2004, 1969, 1946, 1899, 1841, 1806,
"Cychrus caraboides (L.)", 0, 0, 0, 0, 0, 0.01,
"Leistus terminatus (Hellwig)", 0.01, 0, 0, 0, 0, 0,
"Leistus sp.", 0, 0.01, 0, 0, 0, 0,
"Notiophilus palustris (Duft.)", 0, 0, 0, 0, 0.02, 0,
"Notiophilus biguttatus (F.)", 0, 0, 0, 0.02, 0, 0,
"Loricera pilicornis (F.)", 0, 0, 0, 0, 0, 0.01,
"Dyschirius globosus (Hbst.)", 0.01, 0, 0, 0, 0, 0,
"Trechus amplicollis Fairm.", 0, 0.01, 0.05, 0.02, 0, 0
#Library vegan
library(vegan)
Df_full <- Diera_Hollow_August_2019_beetle_data
row.names(Df_full)<-Df_full$SpeciesName
Df_raw = subset(Df_full, select = -c(SpeciesName))
Df_pollen <- Pollen_Diera_hollow
row.names(Df_pollen)<- Df_pollen$SpeciesName
Df_pollen = subset(Df_pollen, select = -c(SpeciesName))
#Tried to name the columns of the beetle data but this had no effect on the later plotting:
names(Df_raw) <- c("2004","1969","1946","1899","1841","1806","1737","1693","1638","1593","1504","1388","1271","1136","1083","1030","978","926")
#Plotting of the Shannon diversity of untransposed raw counts data
plot(diversity(Df_raw, index = "shannon", MARGIN = 2, base = exp(1)), xlab="Sample number", ylab="Diversity-index")
title("Shannon diversity beetles")
plot(diversity(Df_pollen, index = "shannon", MARGIN = 2, base = exp(1)), xlab="Sample number", ylab="Diversity-index")
title("Shannon diversity pollen")
#So on both of the plots I would like to have the est. calendar dates AD of the samples(columns) displayed, rather than number 1:18. And as the pollen data has around 80 data points with calendar dates, it would be great if this can be done by selecting just a row and take all the data out of there.
#It would be great if this is possible. Then, I was also wondering if both figures (beetle and pollen diversity) could be combined into one figure where the 'beetle' data points are red and the 'pollen' data are black.