Hello,
I'm trying to figure out how to use R to calculate the rate of changes between samples with beetle remains (so I would like the rate of change to be based on squared-chord distances between samples).
Below is a tiny bit of my data, in total it's 19 samples and 283 species, often a species has only one count in one of the 19 samples.
Beetles <- tibble::tribble(
~SpeciesName, ~S1, ~S2, ~S3, ~S4, ~S5, ~S6,
"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
)
head(Beetles)
#> # A tibble: 6 x 7
#> SpeciesName S1 S2 S3 S4 S5 S6
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 Cychrus caraboides (L.) 0 0 0 0 0 0.01
#> 2 Leistus terminatus (Hellwig) 0.01 0 0 0 0 0
#> 3 Leistus sp. 0 0.01 0 0 0 0
#> 4 Notiophilus palustris (Duft.) 0 0 0 0 0.02 0
#> 5 Notiophilus biguttatus (F.) 0 0 0 0.02 0 0
#> 6 Loricera pilicornis (F.) 0 0 0 0 0 0.01
I have read a few techniques, one in the Vegan package and one in another package that I forgot, that show the distances between two different data sets. But I would like to calculate the distances between the columns within one data set (each column is a different sample, S1, S2, S3,..., with a different age) and I couldn't find the solution.