Introduction

Dendrochronological analyses are often based on the comparison of tree-ring series with other tree-ring series. These comparions are often visualised as tabular data. However, to analyse the complex system of relations between tree-ring curves other methods are necessary. The author has developed a method to analyse patterns of similarity between tree-ring series using network analysis (Visser, 2021a; Visser & Vorst, 2022). The analyses of these papers was mostly based on scripts that are shared with the papers (Visser, n.d., n.d.). For others to apply the developed method with these scripts is possible, but cumbersome and various things need to be changed. In addition, to try the network approach on dendrochronological data for the first time can be overwhelming an seemingly difficult. To make this more easy and accessible a new package for R has been designed to help users to apply this method to their data. The package dendroNetwork enables researchers to create tables with the similarity using various measures and visualize these using R (R Core Team, 2022) and Cytoscape (Otasek, Morris, Bouças, Pico, & Demchak, 2019; Shannon et al., 2003). Cytoscape is an open source and platform independent tool for network analysis and visualization. The software provides easy visual access to complex networks and the attributes of both nodes and edges in a network. The dendroNetwork package has been reviewed on ROpenSci (https://github.com/ropensci/dendroNetwork and https://docs.ropensci.org/dendroNetwork/).

Statement of need

There are several packages available in R for dendrochronological research (Alday, Shestakova, Resco de Dios, & Voltas, 2018; Altman, Fibich, Dolezal, & Aakala, 2014; Bunn, 2008; Campelo, García-González, & Nabais, 2012; Campelo, Mayer, & Grabner, 2019; Guiterman, Lynch, & Axelson, 2020; Haneca, 2023; Jevšenak & Levanič, 2018; Maaten-Theunissen, Maaten, & Bouriaud, 2015; Malevich, Guiterman, & Margolis, 2018; Rademacher et al., n.d.; Reynolds, Edge, & Black, 2021; Shi, Xiang, Liu, & Shah, 2019). An overview with links to these packages can be found online (https://ronaldvisser.github.io/Dendro_R/). Some packages are specifically creates to obtain measurements (Campelo et al., 2019; Shi et al., 2019), while others are written for crossdating (Reynolds et al., 2021). There are also various for analysing tree-ring data (Alday et al., 2018, 2018; Altman et al., 2014; Bunn, 2008; Campelo et al., 2012; Guiterman et al., 2020; Zang & Biondi, 2015). These R-packages in dendrochronology all fill different needs, but the nice thing is that these are all interconnected in some way in depending on each other, or that they build further into different avenues. Apart from depending on dendrochronological packages, various packages from the Tidyverse (Wickham et al., 2019) are often also needed. The various relations can easily be visualised using a network, with the edges based on the dependency of two packages on each other, and and arrow indicating the direction of the dependency. Some R-package for dendrochronology or tree-ring studies have no relation with others, but fill specific needs (Aryal, Häusser, Grießinger, Fan, & Bräuning, 2020; Campelo, Nabais, Carvalho, & Vieira, 2016; Lara, Bogino, & Bravo, 2018; Peters et al., 2018). These are left out of the network (see Figure 1).

The interdependent relations between existing R-packages related to dendrochronology

Figure 1: The interdependent relations between existing R-packages related to dendrochronology

The network shows that nearly all packages depend on dplR (Bunn, 2008). The newly created package dendroNetwork fits in this ecosystem of depending packages, since it depends on both dplR and the Tidyverse. In addition, it adds a whole new world by adding network analyses through igraph (Csardi & Nepusz, 2006) to the ecosystem of dendrochronological packages. The igraph library has close connections to the tidyverse, creating a full circle and filling a gap as shown in the networks below (see Figure 2).

The interdependent relations between R-packages including dendroNetwork. On the left only the dependencies for dendroNetwork, on the right all dendrochronological R-packages, including dendroNetworkThe interdependent relations between R-packages including dendroNetwork. On the left only the dependencies for dendroNetwork, on the right all dendrochronological R-packages, including dendroNetwork

Figure 2: The interdependent relations between R-packages including dendroNetwork. On the left only the dependencies for dendroNetwork, on the right all dendrochronological R-packages, including dendroNetwork

Workflow using dendroNetwork

The typical workflow when using the package consists of a number of successive steps (see Figure 3). The result of each step is input for the next step.

Figure 3: The typcial workflow when using dendroNetwork to visualise a network

This first step is to load the package and subsequently the dendrochronological data into the R environment using dplR:

library(dendroNetwork)
data(hol_rom)

The next step would involve calculating the similarities between each tree-ring series in the dataset.

sim_table_hol <- sim_table(hol_rom)

In the next step edges of the network are created based on the similarity. Each similarity between two curves above certain threshold settings will result in an edge in the network. The default settings are 0.5 for the correlation, 0.7 for the Synchronous Growth Changes or sgc (Visser, 2021b) with a probability of exceedence below 0.0001.

g_hol <- dendro_network(sim_table_hol)

The next steps will be to find communities using either the Girvan-Newman algorithm (Girvan & Newman, 2002) or clique percolation method (Palla, Derenyi, Farkas, & Vicsek, 2005) , or both.

g_hol_gn <- gn_names(g_hol)
g_hol_cpm <- clique_community_names(g_hol, k=3)
hol_com_cpm_all <- find_all_cpm_com(g_hol)

The next step is to visualize and explore the networks using Cytoscape or using R (see Figure 4). Various functions are available to create visual styles for the communities in Cytoscape from R.

Network of the dendrochronological site chronologies in hol_rom

Figure 4: Network of the dendrochronological site chronologies in hol_rom

The main advantage is that visualisation in Cytoscape is more easy, intuitive and visual. In addition, it is very easy to automate workflows in Cytoscape with R (using RCy3). For this purpose we need to start Cytoscape firstly. After Cytoscape has completely loaded, the next steps can be taken.

  1. The network can now be loaded in Cytoscape for further visualisation: cyto_create_graph(g_hol, CPM_table = hol_com_cpm_all, GN_table = g_hol_gn)
  2. Styles for visualisation can now be generated. However, Cytoscape comes with a lot of default styles that can be confusing. Therefore it is recommended to use: cyto_clean_styles() once in a session.
  3. To visualize the styles for CPM with only k=3: cyto_create_cpm_style(g_hol, k=3, com_k = g_hol_cpm)
    • This can be repeated for all possible clique sizes. To find the maximum clique size in a network, please use: igraph::clique_num(g_hol).
    • To automate this: for (i in 3:igraph::clique_num(g_hol)) { cyto_create_cpm_style(g_hol, k=i, com_k = g_hol_cpm)}.
  4. To visualize the styles using the Girvan-Newman algorithm (GN): This would look something like this in Cytoscape (see Figure 5).
The network of Roman sitechronologies with the Girvan-Newman communities visualized using Cytoscape.

Figure 5: The network of Roman sitechronologies with the Girvan-Newman communities visualized using Cytoscape.

Conclusion

The new R package dendroNetwork has been developed based on earlier research by the author. To enable other researchers to use network analyses on dendrochronological data this new package fills a gap that exists in the current network of R-packages related to dendrochronology by also connecting igraph to the existing packages in the discipline. The creation of networks in R is made easy with various functions and the visualization in Cytoscape is automated in R, enabling the researcher to quickly visualise and analyse the resulting networks in an intuitive manner. The package is easy to use and enables reproducible network analyses within dendrochronology.

Acknowledgements

This package was mostly created in my spare time and I’d like to thank my family for bearing with me. I want to thank Angelino Salentino for creating the orginal function for clique_community_names() and lique_community_names_par(), which I adapted for use in this package (source: https://github.com/angelosalatino/CliquePercolationMethod-R. I want to thank Andy Bunn for the function cor.with.limit.R() which I adapted for use in this package as cor_mat_overlap() (source: https://github.com/AndyBunn/dplR/blob/master/R/rwi.stats.running.R).

References

Alday, J. G., Shestakova, T. A., Resco de Dios, V., & Voltas, J. (2018). DendroSync: An r package to unravel synchrony patterns in tree-ring networks. Dendrochronologia, 47, 17–22. doi:10.1016/j.dendro.2017.12.003
Altman, J., Fibich, P., Dolezal, J., & Aakala, T. (2014). TRADER: A package for tree ring analysis of disturbance events in r. Dendrochronologia, 32(2), 107–112. doi:10.1016/j.dendro.2014.01.004
Aryal, S., Häusser, M., Grießinger, J., Fan, Z., & Bräuning, A. (2020). dendRoAnalyst: A tool for processing and analysing dendrometer data. Dendrochronologia, 64, 125772. doi:10.1016/j.dendro.2020.125772
Bunn, A. G. (2008). A dendrochronology program library in r (dplR). Dendrochronologia, 26(2), 115124. doi:https://doi.org/10.1016/j.dendro.2008.01.002
Campelo, F., García-González, I., & Nabais, C. (2012). detrendeR - a graphical user interface to process and visualize tree-ring data using r. Dendrochronologia, 30, 57–60. doi:16/j.dendro.2011.01.010
Campelo, F., Mayer, K., & Grabner, M. (2019). xRingAn R package to identify and measure tree-ring features using X-ray microdensity profiles. Dendrochronologia, 53, 17–21. doi:10.1016/j.dendro.2018.11.002
Campelo, F., Nabais, C., Carvalho, A., & Vieira, J. (2016). tracheideRan r package to standardize tracheidograms. Dendrochronologia, 37, 64–68. doi:10.1016/j.dendro.2015.12.006
Csardi, G., & Nepusz, T. (2006). The igraph software package for complex network research. InterJournal Complex Systems, 1695(5), 1–9. Retrieved from https://igraph.org
Girvan, M., & Newman, M. E. J. (2002). Community structure in social and biological networks. Proceedings of the National Academy of Sciences of the United States of America, 99(12), 7821–7826. doi:10.1073/pnas.122653799
Guiterman, C. H., Lynch, A. M., & Axelson, J. N. (2020). dfoliatR: An R package for detection and analysis of insect defoliation signals in tree rings. Dendrochronologia, 63, 125750. doi:10.1016/j.dendro.2020.125750
Haneca, K. (2023). fellingdateR: An r package to facilitate the organisation, analysis and interpretation of tree-ring data from wooden heritage objects and structures. Retrieved from https://github.com/hanecakr/fellingDateR
Jevšenak, J., & Levanič, T. (2018). dendroTools: R package for studying linear and nonlinear responses between tree-rings and daily environmental data. Dendrochronologia, 48, 32–39. doi:10.1016/j.dendro.2018.01.005
Lara, W., Bogino, S., & Bravo, F. (2018). Multilevel analysis of dendroclimatic series with the R-package BIOdry. PLOS ONE, 13(5), e0196923. doi:10.1371/journal.pone.0196923
Maaten-Theunissen, M. van der, Maaten, E. van der, & Bouriaud, O. (2015). pointRes: An r package to analyze pointer years and components of resilience. Dendrochronologia, 35, 34–38. doi:10.1016/j.dendro.2015.05.006
Malevich, S. B., Guiterman, C. H., & Margolis, E. Q. (2018). Burnr: Fire history analysis and graphics in r. Dendrochronologia, 49, 9–15. doi:10.1016/j.dendro.2018.02.005
Otasek, D., Morris, J. H., Bouças, J., Pico, A. R., & Demchak, B. (2019). Cytoscape automation: Empowering workflow-based network analysis. Genome Biology, 20(1), 185. doi:10.1186/s13059-019-1758-4
Palla, G., Derenyi, I., Farkas, I., & Vicsek, T. (2005). Uncovering the overlapping community structure of complex networks in nature and society. Nature, 435(7043), 814–818. doi:10.1038/nature03607
Peters, R. L., Balanzategui, D., Hurley, A. G., Arx, G. von, Prendin, A. L., Cuny, H. E., Björklund, J., et al. (2018). RAPTOR: Row and position tracheid organizer in r. Dendrochronologia, 47, 10–16. doi:10.1016/j.dendro.2017.10.003
R Core Team. (2022). R: A language and environment for statistical computing. Vienna: R Foundation for Statistical Computing. Retrieved from https://www.r-project.org
Rademacher, T., Seyednasrollah, B., Basler, D., Cheng, J., Mandra, T., Miller, E., Lin, Z., et al. (n.d.). The Wood Image Analysis and Dataset (WIAD): Open-access visual analysis tools to advance the ecological data revolution. Methods in Ecology and Evolution, n/a(n/a). doi:10.1111/2041-210X.13717
Reynolds, D. J., Edge, D. C., & Black, B. A. (2021). RingdateR: A statistical and graphical tool for crossdating. Dendrochronologia, 65, 125797. doi:10.1016/j.dendro.2020.125797
Shannon, P., Markiel, A., Ozier, O., Baliga, N. S., Wang, J. T., Ramage, D., Amin, N., et al. (2003). Cytoscape: A software environment for integrated models of biomolecular interaction networks. Genome Research, 13(11), 2498–2504. doi:10.1101/gr.1239303
Shi, J., Xiang, W., Liu, Q., & Shah, S. (2019). MtreeRing: An R package with graphical user interface for automatic measurement of tree ring widths using image processing techniques. Dendrochronologia, 58, 125644. doi:10.1016/j.dendro.2019.125644
Visser, R. M. (n.d.). Dendrochronological provenance patterns. Code and data of network analysis of tree-ring material. doi:10.5281/zenodo.10200361
Visser, R. M. (2021a). Dendrochronological Provenance Patterns. Network Analysis of Tree-Ring Material Reveals Spatial and Economic Relations of Roman Timber in the Continental North-Western Provinces. Journal of Computer Applications in Archaeology, 4(1), 230253. doi:10.5334/jcaa.79
Visser, R. M. (2021b). On the similarity of tree-ring patterns: Assessing the influence of semi-synchronous growth changes on the Gleichläufigkeitskoeffizient for big tree-ring data sets. Archaeometry, 63(1), 204–215. doi:https://doi.org/10.1111/arcm.12600
Visser, R. M., & Vorst, Y. (2022). Connecting Ships: Using Dendrochronological Network Analysis to Determine the Wood Provenance of Roman-Period River Barges Found in the Lower Rhine Region and Visualise Wood Use Patterns. International Journal of Wood Culture, 3(1-3), 123–151. doi:10.1163/27723194-bja10014
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L. D., François, R., Grolemund, G., et al. (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686. doi:10.21105/joss.01686
Zang, C., & Biondi, F. (2015). treeclim: an R package for the numerical calibration of proxy-climate relationships. Ecography, 38(4), 431–436. doi:10.1111/ecog.01335