Earth Science Informatics

, Volume 12, Issue 4, pp 685–697 | Cite as

KarsTS: an R package for microclimate time series analysis

  • M. Sáez
  • C. Pla
  • S. Cuezva
  • D. BenaventeEmail author
Software Article


KarsTS 2.2 is free, open-source, R-based software for microclimate time series, especially suited to the study of underground or highly insulated environments. The time series of interest include air temperature, humidity, and CO2 and 222Rn content, amongst others. These time series usually pose problems such as gaps, outliers, noise or relative shortness. KarsTS was born as a package for gap filling and thus, it offers multiple univariate and multivariate gap-filling tools well suited to these variables. However, as KarsTS was intended to be a self-sufficient program, it soon grew to encompass several tools for linear and nonlinear time series analysis, preprocessing and plotting. Indeed, many of these variables show a nonlinear behavior that is often disregarded; for this reason, we aim to spread and facilitate the use of some methodologically appropriate analysis tools, even amongst researcher that do not feel comfortable using a console. In this paper, we introduce an overview of KarsTS functionality and we show its potential through some practical application examples on four-year time series of temperature from the Rull cave (Spain).


Microclimate Caves R package Nonlinear Missing values Recurrence analysis 



This research was funded by the Spanish Ministry of Economy and Competitiveness Projects [CGL2011-25162, CGL2016-78318-C2-1-R, CGL2016-78318-C2-2-R and RTI2018-099052-B-I00]. A post-doctoral research fellowship was awarded to S. Cuezva by the University of Almería (Hipatia Programme). We also thank Dr. S. Mangiarotti for his useful discussions.

Supplementary material

12145_2019_393_MOESM1_ESM.docx (26 kb)
Supplementary Material 1 (DOCX 25 kb)
12145_2019_393_MOESM2_ESM.docx (18 kb)
Supplementary Material 2 (DOCX 17 kb)


  1. Abarbanel HD, Brown R, Sidorowich JJ, Tsimring LS (1993) The analysis of observed chaotic data in physical systems. Rev Mod Phys 65:1331–1392CrossRefGoogle Scholar
  2. Alvarez-Gallego M, Garcia-Anton E, Fernandez-Cortes A, Cuezva S, Sanchez-Moral S (2015) High radon levels in subterranean environments: monitoring and technical criteria to ensure human safety (case of Castañar cave, Spain). J Environ Radioact 145:19–29CrossRefGoogle Scholar
  3. Amritkar R, Kumar PP (1995) Interpolation of missing data using nonlinear and chaotic system analysis. J Geophys Res-Atmos 100(D2):3149–3154CrossRefGoogle Scholar
  4. Baldini JU, Baldini LM, McDermott F, Clipson N (2006) Carbon dioxide sources, sinks, and spatial variability in shallow temperate zone caves: evidence from Ballynamintra cave, Ireland. J Caves Karst Stud 68:4–11Google Scholar
  5. Bjornstad ON (2017) nlts: (non)linear time series analysis. R package version 0.2–2Google Scholar
  6. Bourges F, Genthon P, Genty D, Lorblanchet M, Mauduit E, D'Hulst D (2014) Conservation of prehistoric caves and stability of their inner climate: lessons from Chauvet and other French caves. Sci Total Environ 493:79–91CrossRefGoogle Scholar
  7. Bradley E, Mantilla R (2002) Recurrence plots and unstable periodic orbits. CHAOS 12:596–600CrossRefGoogle Scholar
  8. Buuren S, Groothuis-Oudshoorn K (2011) mice: multivariate imputation by chained equations in R. J Stat Softw 45Google Scholar
  9. Camuffo D, Pagan E, Bernardi A, Becherini F (2004) The impact of heating, lighting and people in re-using historical buildings: a case study. J Cult Herit 5:409–416CrossRefGoogle Scholar
  10. Coco MI, Dale R (2014) Cross-recurrence quantification analysis of categorical and continuous time series: an R package. Front Psychol 5Google Scholar
  11. Cuezva S, Fernandez-Cortes A, Benavente D, Serrano-Ortiz P, Kowalski A, Sanchez-Moral S (2011) Short-term CO2(g) exchange between a shallow karstic cavity and the external atmosphere during summer: role of the surface soil layer. Atmos Environ 45:1418–1427CrossRefGoogle Scholar
  12. Dengel S, Zona D, Sachs T, Aurela M, Jammet M, Parmentier FJW, Oechel W, Vesala T (2013) Testing the applicability of neural networks as a gap-filling method using CH4 flux data from high latitude wetlands. Biogeosciences 10:8185–8200CrossRefGoogle Scholar
  13. Di Narzo A, Di Narzo F (2013) tseriesChaos: Analysis of nonlinear time series. R package version 0.1–13Google Scholar
  14. Fairchild IJ, Smith CL, Baker A, Fuller L, Spötl C, Mattey D, McDermott F (2006) Modification and preservation of environmental signals in speleothems. Earth Sci Rev 75:105–153CrossRefGoogle Scholar
  15. Falge E, Baldocchi D, Olson R, Anthoni P, Aubinet M, Bernhofer C, Burba G, Ceulemans R, Clement R, Dolman H, Granier A, Gross P, Grünwald T, Hollinger D, Jensen NO, Katul G, Keronen P, Kowalski A, Lai CT, Law BE, Meyers T, Moncrieff J, Moors E, Munger JW, Pilegaard K, Rannik Ü, Rebmann C, Suyker A, Tenhunen J, Tu K, Verma S, Vesala T, Wilson K, Wofsy S (2001a) Gap filling strategies for long term energy flux data sets. Agric For Meteorol 107:71–77CrossRefGoogle Scholar
  16. Falge E, Baldocchi D, Olson R, Anthoni P, Aubinet M, Bernhofer C, Burba G, Ceulemans R, Clement R, Dolman H, Granier A, Gross P, Grünwald T, Hollinger D, Jensen NO, Katul G, Keronen P, Kowalski A, Lai CT, Law BE, Meyers T, Moncrieff J, Moors E, Munger JW, Pilegaard K, Rannik Ü, Rebmann C, Suyker A, Tenhunen J, Tu K, Verma S, Vesala T, Wilson K, Wofsy S (2001b) Gap filling strategies for defensible annual sums of net ecosystem exchange. Agric For Meteorol 107:43–69CrossRefGoogle Scholar
  17. Fernandez-Cortes A, Cuezva S, Alvarez-Gallego M, Garcia-Anton E, Pla C, Benavente D, Jurado V, Saiz-Jimenez C, Sanchez-Moral S (2015) Subterranean atmospheres may act as daily methane sinks. Nat Commun 6:ncomms8003CrossRefGoogle Scholar
  18. Fox J, Bouchet-Valat M (2017) Rcmdr: R commander. R package version 2.4–1Google Scholar
  19. Garcia CA (2015) nonlinearTseries: nonlinear time series analysis. R package version 0.2.3Google Scholar
  20. Garcia SR, Romo MP, Figueroa-Nazuno J (2013) Characterization of ground motions using recurrence plots. Geof Inter 52:209–227CrossRefGoogle Scholar
  21. Garcia-Anton E, Cuezva S, Fernandez-Cortes A, Alvarez-Gallego M, Pla C, Benavente D, Cañaveras JC, Sanchez-Moral S (2017) Abiotic and seasonal control of soil-produced CO2 efflux in karstic ecosystems located in oceanic and Mediterranean climates. Atmos Environ 164:31–49CrossRefGoogle Scholar
  22. Giannerini S (2017) tseriesEntropy: entropy based analysis and tests for time series. R package version 0.6–0Google Scholar
  23. Grosjean P (2014) SciViews: a GUI API for R. UMONS Mons, BelgiumGoogle Scholar
  24. Grunsky EC (2002) R: a data analysis and statistical programming environment–an emerging tool for the geosciences. Comput Geosci 28:1219–1222CrossRefGoogle Scholar
  25. Harrell FE (2017) Hmisc: Harrell Miscellaneous. R package version 4.0–3Google Scholar
  26. Honaker J, King G, Blackwell M (2011) Amelia II: a program for missing data. J Stat Softw 45:1–47CrossRefGoogle Scholar
  27. Kennel MB, Brown R, Abarbanel HD (1992) Determining embedding dimension for phase-space reconstruction using a geometrical construction. Phys Rev A 45:3403–3411CrossRefGoogle Scholar
  28. Letellier C, Moroz I, Gilmore R (2008) Comparison of tests for embeddings. Phys Rev E 78:026203CrossRefGoogle Scholar
  29. Mangiarotti S, Coudret R, Drapeau L, Jarlan L (2012a) Polynomial search and global modeling: two algorithms for modeling chaos. Phys Rev E 86:046205CrossRefGoogle Scholar
  30. Mangiarotti S, Mazzega P, Hiernaux P, Mougin E (2012b) Predictability of vegetation cycles over the semi-arid region of Gourma (Mali) from forecasts of AVHRR-NDVI signals. Remote Sens Environ 123:246–257CrossRefGoogle Scholar
  31. March TK, Chapman SC, Dendy RO (2005) Recurrence plot statistics and the effect of embedding. Physica D 200:171–184CrossRefGoogle Scholar
  32. Marwan N (2011) How to avoid potential pitfalls in recurrence plot based data analysis. Int J Bifurcat Chaos 21:1003–1017CrossRefGoogle Scholar
  33. Marwan N, Kurths J (2005) Line structures in recurrence plots. Phys Lett A 336:349–357CrossRefGoogle Scholar
  34. Marwan N, Trauth MH, Vuille M, Kurths J (2003) Comparing modern and Pleistocene ENSO-like influences in NW Argentina using nonlinear time series analysis methods. Clim Dyn 21:317–326CrossRefGoogle Scholar
  35. Marwan N, Romano MC, Thiel M, Kurths J (2007) Recurrence plots for the analysis of complex systems. Phys Rep 438:237–329CrossRefGoogle Scholar
  36. Moffat AM, Papale D, Reichstein M, Hollinger DY, Richardson AD, Barr AG, Beckstein C, Braswell BH, Churkina G, Desai AR, Falge E, Gove JH, Heimann M, Hui D, Jarvis AJ, Kattge J, Noormets A, Stauch VJ (2007) Comprehensive comparison of gap-filling techniques for eddy covariance net carbon fluxes. Agric For Meteorol 147:209–232CrossRefGoogle Scholar
  37. Nichols JM, Trickey ST, Seaver M (2006) Damage detection using multivariate recurrence quantification analysis. Mech Syst Signal Process 20:421–437CrossRefGoogle Scholar
  38. Perrier F, Richon P (2010) Spatiotemporal variation of radon and carbon dioxide concentrations in an underground quarry: coupled processes of natural ventilation, barometric pumping and internal mixing. J Environ Radioact 101(4):279–296CrossRefGoogle Scholar
  39. Pla C, Cuezva S, Garcia-Anton E, Fernandez-Cortes Á, Cañaveras JC, Sanchez-Moral S, Benavente D (2016a) Changes in the CO2 dynamics in near-surface cavities under a future warming scenario: factors and evidence from the field and experimental findings. Sci Total Environ 565(565):1151–1164CrossRefGoogle Scholar
  40. Pla C, Galiana-Merino JJ, Cuezva S, Fernandez-Cortes Á, Cañaveras JC, Benavente D (2016b) Assessment of CO2 dynamics in subsurface atmospheres using the wavelet approach: from cavity–atmosphere exchange to anthropogenic impacts in Rull cave (Vall d0Ebo, Spain). Environ Earth Sci 75(6).
  41. Pla C, Cuezva S, Martínez-Martínez J, Fernandez-Cortes Á, García-Antón E, Fusi N, Crosta GB, Cuevas-González J, Cañaveras JC, Sanchez-Moral S, Benavente D (2017) Role of soil pore structure in water infiltration and CO2 exchange between the atmosphere and underground air in the vadose zone: a combined laboratory and field approach. Catena 149:402–416CrossRefGoogle Scholar
  42. Poulain A, Rochez G, Bonniver I, Hallet V (2015) Stalactite drip-water monitoring and tracer tests approach to assess hydrogeologic behavior of karst vadose zone: case study of Han-Sur-Lesse (Belgium). Environ Earth Sci 74:7685–7697CrossRefGoogle Scholar
  43. Romano MC, Thiel M, Kurths J, Kiss IZ, Hudson JL (2005) Detection of synchronization for non-phase-coherent and non-stationary data. Europhys Lett 71:466–472CrossRefGoogle Scholar
  44. Stekhoven DJ (2013) missForest: nonparametric missing value imputation using random Forest. R package version 1.4Google Scholar
  45. Strozzi F, Gutierrez E, Noe C, Rossi T, Serati M, Zaldivar JM (2007) Application of non-linear time series analysis techniques to the nordic spot electricity market data. Liuc PapersGoogle Scholar
  46. Su YS, Gelman A, Hill J, Yajima M (2011) Multiple imputation with diagnostics (mi) in R: opening windows into the black box. J Stat Softw 45:1–31CrossRefGoogle Scholar
  47. Takens F (1981) Detecting strange attractors in turbulence. In: Rand D., Young LS. (eds) Dynamical systems and turbulence, Warwick 1980. Lecture notes in mathematics, vol 898. Springer, 366–381Google Scholar
  48. Thiel M, Romano MC, Kurths J, Rolfs M, Kliegl R (2008) Generating surrogates from recurrences. Philos Trans Royal Soc A 366:545–557CrossRefGoogle Scholar
  49. Webber CL (2012) Recurrence quantification of fractal structures. Front Physiol 3Google Scholar
  50. Wuertz D, Setz T, Chalabi Y (2017) fNonlinear: Rmetrics - nonlinear and chaotic time series modelling. R package version 3042.79Google Scholar
  51. Zhao X, Huang Y (2015) A comparison of three gap filling techniques for eddy covariance net carbon fluxes in short vegetation ecosystems. Adv Meteorol 260580:12Google Scholar
  52. Zhao P, Xingb L, Yuc J (2009) Chaotic time series prediction: from one to another. Phys Lett A 373:2174–2177CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Departamento de Ciencias de la Tierra y del Medio AmbienteUniversidad de AlicanteAlicanteSpain
  2. 2.Departamento de Ingeniería CivilUniversidad de AlicanteAlicanteSpain
  3. 3.Departamento de Biología y GeologíaUniversidad de AlmeríaAlmeríaSpain

Personalised recommendations