RCarb/0000755000175000017500000000000014204520032011365 5ustar nileshnileshRCarb/MD50000644000175000017500000000331514204520032011677 0ustar nileshnilesh8fafb8fb039932d79bd4aaabaa1bb1f8 *DESCRIPTION b64e46a0584ad27aa375dbaa291f3ed6 *NAMESPACE 72537819f6a72b75b4c8f4532d87c41f *NEWS.md c4c9c24e8a4650a2ab22e8fb2c8405d5 *R/RCarb-package.R 8fb3c13bbe97dea0c11e009b84137a61 *R/calc_DoseRate.R 7856d680665c63f050fc9a87bfc3848a *R/internals_RCarb.R 53fb4e111781eadadd6f09cd5c4d68e1 *R/model_DoseRate.R 94f67c4eb56d6087a20578ab6fc51dea *R/write_InputTemplate.R 163b69b2961fda78b2c9e0a7e6c575b8 *README.md 2220deac6bfd019491650bc99bfe5779 *build/partial.rdb d61f90ec530779e97a7274e257bdf5e5 *build/vignette.rds 19213478bfe3b7caa1199d5acc0581cb *data/Example_Data.rda df1e2a08bf99c7009b09024dc39f7591 *data/Reference_Data.rda e532973fe8192b7765276599c5c57bd5 *data/datalist 024a8c45938e7befe4ebf7adb2126ba7 *inst/CITATION a9505f139c92b3472e60002d425bb204 *inst/WORDLIST bf035a3ad93f2e80a923292234b66e94 *inst/doc/GetStarted.html 47830939a2d0630243e3589fe76f1cc9 *inst/doc/GetStarted.html.asis bb12f5bea4c6cd56265cd956d763c523 *man/Example_Data.Rd 2f1f8e2f4e5fda04b948ed21b15ab847 *man/RCarb-package.Rd 7a29b485a0c85a0c1e4b0342028c810f *man/Reference_Data.Rd 9b8b117298976a4e2726e7e711767977 *man/figures/Logo_RCarb.svg d4d197e3c97b24cefb4ccde4055f9dee *man/figures/README-unnamed-chunk-2-1.png a2433c268dc5df741a30972c9ca877fe *man/model_DoseRate.Rd 91c7d17c7916e0711b2f40ef1d532cef *man/write_InputTemplate.Rd 7fed4fcac118ef18b192f1a1ef4ec33b *tests/testthat.R f7ecde458c4a23d1df34b35b4b30a97e *tests/testthat/test_.cal_DoseRate.R be83ad57a267fbdda276d98ed7b7367d *tests/testthat/test_model_DoseRate.R eb2c0d706f6c0f431fae71c3390e2078 *tests/testthat/test_write_InputTemplate.R 7a018e106f83687c727ecf0c588c18c7 *vignettes/GetStarted.Rmd 47830939a2d0630243e3589fe76f1cc9 *vignettes/GetStarted.html.asis RCarb/NEWS.md0000644000175000017500000000335114203705616012501 0ustar nileshnilesh ## RCarb 0.1.5 (2022-02-18) **This update requires R \>= 4.0** - Update internal tests to support `'testthat'` \>=3.0 - Address a CRAN request concerning the logo of RCarb. ## RCarb 0.1.4 (2020-09-15) ### Bugfixes and changes - This version of the package requires R \>= 3.5.0 - If an external dataset was used, the `model_DoseRate()` sometimes did not display the sample id correctly in the terminal output; corrected. - `model_DoseRate()` gained a new argument `par_local`, which is `TRUE` by default. If set to `FALSE` all global par settings are accepted. ## RCarb 0.1.3 (2019-06-02) ### New features - The reference dataset got a new dataset called `Reference_Data$DR_conv_factors` to support different dose rate conversion factors - The function `model_DoseRate()` gained are new argument `DR_conv_factors` to support different dose rate conversion factors ### Bugfixes - In case values for U-238 and U-234 were provided, for the gamma-dose rate contribution, erroneously the beta-dose water correction factors were used; now corrected (internal function `.calc_DoseRata()`). This bug already existed in *Carb* and was probably introduced by copy & paste actions. ### Other modifications - Add README.md - Modify output graphics and add more information - Update dependency and package version requirements ## RCarb 0.1.2 (2018-12-02) - Update internal references - Modify example in write_InputTemplate() to comply with CRAN requests ## RCarb 0.1.1 (2018-11-20) - Internal changes only to account for CRAN comments on initial submission. ## RCarb 0.1.0 (2018-11-12) - Initial version RCarb/DESCRIPTION0000644000175000017500000000262214204520032013075 0ustar nileshnileshPackage: RCarb Type: Package Title: Dose Rate Modelling of Carbonate-Rich Samples Version: 0.1.5 Date: 2022-02-18 Author: Sebastian Kreutzer [aut, trl, cre, dtc] (), Roger P. Nathan [aut, cph], Barbara Mauz [aut, cph] () Authors@R: c( person("Sebastian", "Kreutzer", role = c("aut", "trl", "cre", "dtc"), email = "sebastian.kreutzer@aber.ac.uk", comment = c(ORCID = "0000-0002-0734-2199")), person("Roger P.", "Nathan", role = c("aut", "cph")), person("Barbara", "Mauz", role = c("aut", "cph"), comment = c(ORCID = "0000-0003-1504-333X"))) Maintainer: Sebastian Kreutzer Description: Translation of the 'MATLAB' program 'Carb' (Nathan and Mauz 2008 ; Mauz and Hoffmann 2014) for dose rate modelling for carbonate-rich samples in the context of trapped charged dating (e.g., luminescence dating) applications. Depends: R (>= 4.0), utils Imports: interp (>= 1.0), matrixStats (>= 0.61.0) Suggests: testthat (>= 3.1.0), R.rsp (>= 0.44.0) URL: https://r-lum.github.io/RCarb/ BugReports: https://github.com/R-Lum/RCarb/issues License: GPL-3 Encoding: UTF-8 Language: en-GB LazyData: true VignetteBuilder: R.rsp RoxygenNote: 7.1.2 NeedsCompilation: no Packaged: 2022-02-18 12:05:40 UTC; kreutzer Repository: CRAN Date/Publication: 2022-02-20 20:10:02 UTC RCarb/README.md0000644000175000017500000000724314203705616012666 0ustar nileshnilesh # RCarb [![CRAN](https://www.r-pkg.org/badges/version/RCarb)](https://CRAN.R-project.org/package=RCarb) [![cran checks](https://cranchecks.info/badges/worst/RCarb)](https://cranchecks.info/pkgs/RCarb) [![DOI](https://zenodo.org/badge/151577249.svg)](https://zenodo.org/badge/latestdoi/151577249) [![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/RCarb)](https://www.r-pkg.org/pkg/RCarb) [![R-CMD-check](https://github.com/R-Lum/RCarb/workflows/GitHub%20Actions%20CI/badge.svg)](https://github.com/R-Lum/RCarb/actions) [![codecov](https://app.codecov.io/gh/R-Lum/RCarb/branch/master/graph/badge.svg)](https://app.codecov.io/gh/R-Lum/RCarb) The **R** package `'RCarb'` provides a collection of various R functions to model dose rates in carbonate-rich samples. The package is a translation of the `'MATLAB'` program *Carb* by Roger P. Nathan. ## Installation of the developer version To install the latest development builds of `'RCarb'` directly from GitHub, run ``` r if(!require("devtools")) install.packages("devtools") devtools::install_github("R-Lum/RCarb@master") ``` To install a developer build other than `'master'`, replace the term `'master'` in the code line by the name of the wanted developer build (not available yet). Please further note that our ‘GitHub’ versions are developer versions and subject to daily changes. For stable please versions download the package from [CRAN](https://CRAN.R-project.org/package=RCarb). ## License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](https://github.com/R-Lum/RCarb/blob/master/LICENSE) for more details. ## Related projects - [Luminescence](https://github.com/R-Lum/Luminescence) - [RLumModel](https://github.com/R-Lum/RLumModel) - [RLumCarlo](https://github.com/R-Lum/RLumCarlo) - [RLumShiny](https://github.com/R-Lum/RLumShiny) ## References Kreutzer, S., Mauz, B., Martin, L., Mercier, N., 2019. ‘RCarb’: Dose Rate Modelling of Carbonate-Rich Samples - an Implementation of Carb in R -. Ancient TL 37, 1–8. Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. Radiation Measurements 43, 14–25. doi: [10.1016/j.radmeas.2007.12.012](https://dx.doi.org/10.1016/j.radmeas.2007.12.012) Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the dose rate of carbonate-rich samples. Ancient TL 32, 24–32. **Further reading** Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. DPhil thesis, St Hugh’s College, Oxford. ## Funding - Between 2018-2019, the work of Sebastian Kreutzer as maintainer of the package was supported by LabEx LaScArBxSK (ANR - n. ANR-10-LABX-52). - Between 2020-2022, Sebastian Kreutzer received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 844457 (project: CREDit). RCarb/man/0000755000175000017500000000000014203705624012153 5ustar nileshnileshRCarb/man/Reference_Data.Rd0000644000175000017500000001443414203705615015277 0ustar nileshnilesh% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RCarb-package.R \docType{data} \name{Reference_Data} \alias{Reference_Data} \title{Reference data} \format{ \code{Reference_Data}: \link{list} \cr \tabular{llll}{ \strong{NAME} \tab \strong{TYPE} \tab \strong{DIM} \tab \strong{DESCRIPTION}\cr \code{DATAek} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for K\cr \code{DATAet} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for Th \cr \code{DATAet230} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for Th-230\cr \code{DATAeu} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U\cr \code{DATAeu234} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U-234\cr \code{DATAeu238} \tab \code{matrix} \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U-238\cr \code{DATApk} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for K\cr \code{DATApt} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for T\cr \code{DATApt230} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for Th-230\cr \code{DATApu} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U\cr \code{DATApu234} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U-234\cr \code{DATApu238} \tab \code{matrix} \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U-238\cr \code{mejdahl} \tab \code{data.frame} \tab 36 x 4 \tab beta-dose attenuation values for quartz grains according to Mejdahl (1979) \cr \code{DR_conv_factors} \tab \code{data.frame} \tab 4 x 13 \tab beta and gamma dose rate conversion factors used internally (see details) } } \description{ Reference data and correction factors for beta and gamma radiation used for internal calculations. These values are used instead of the correction factors given in Aitken (1985) for the carbonate model. } \details{ The reference values are used internally to account for: (1) grain size depend beta-attenuation factors (Mejdahl, 1979) and (2) to correct nuclide dependent beta and gamma radiation for water/carbonate proportions. The latter values are given as matrix and precise values are interpolated during the modelling process. Additionally 'RCarb' provides and own set of dose rate conversion factors to convert concentrations of U, Th, and K to dose rate values. Historically \emph{Carb} (and thus 'RCarb') as its own dose rate conversion factors, which differ slightly from other published values. To provide a consistent calculation approach by default the 'old' \emph{Carb} values are used, but the user can further switch (see \link{model_DoseRate}) to values provided by Adamiec \& Aitken (1998), Guérin et al. (2011) or Liritzis et al (2013). Different values quoted for U-238 and U-234 accounts for different activity ratios. For further details on the origin of these data we refer to Nathan \& Mauz (2008) and Nathan (2010).\cr \strong{Nuclear data origin according to Nathan \& Mauz (2008)} The gamma primary energy spectra of uranium, thorium and potassium are drawn from Evaluated Nuclear Structure Data File (ENSDF) database at \url{http://www.nndc.bnl.gov} (2002-01-16) and the beta primary energy spectra was derived from ENSDF end-point energies using a Fermi beta decay model (Evans, 1955) modified by Behrens \& Szybisz (1976). For the simulations of the collisional mass stopping powers for quartz the software ESTAR (Berger et al., 2000) was used. The mass energy-absorption coefficients for quartz were tabulated by Hubbell \& Seltzer (2004). \emph{For further details and references please read Nathan \& Mauz (2008)} } \section{Version}{ 0.2.0 } \examples{ data(Reference_Data, envir = environment()) str(Reference_Data) Reference_Data$DATAek } \references{ Adamiec, G., Aitken, M.J., 1998. Dose-rate conversion factors: update. Ancient TL 16, 37–50. \url{http://ancienttl.org/ATL_16-2_1998/ATL_16-2_Adamiec_p37-50.pdf} Guérin, G., Mercier, N., Adamiec, G., 2011. Dose-rate conversion factors: update. Ancient TL 29, 5–9. \url{http://ancienttl.org/ATL_29-1_2011/ATL_29-1_Guerin_p5-8.pdf} Liritzis, I., Stamoulis, K., Papachristodoulou, C., Ioannides, K., 2013. A Re-Evaluation of Radiation Dose-Rate Conversion Factors. Mediterranean Archaeology and Archaeometry 12, 1–15. \url{http://maajournal.com/Issues/2012/pdf/FullTextLiritzis.pdf} Mejdahl, V., 1979. Thermoluminescence dating: beta-dose attenuation in quartz grains. Archaeometry 21, 61-72. \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421}\cr \strong{Further reading} Aitken, M.J., 1985. Thermoluminescence dating. Academic Press. Berger, M.J., Coursey, J.S., Zucker, M.A., 2000. ESTAR, PSTAR, and ASTAR: Computer Programs for Calculating Stopping-Power and Range Tables for Electrons, Protons, and Helium Ions (version 1.2.2). http://physics.nist.gov/Star (2005-08-09). National Institute of Standards and Technology, Gaithersburg, MD. Behrens, H., Szybisz, L., 1976. Shapes of beta spectra. Physics Data 6-1, Zentralstelle fuer Atomkernenergie-Dokumentation (ZAED), Germany. Evans, R.D., 1955. The Atomic Nucleus. McGraw-Hill, NY. Hubbell, J.H., Seltzer, S.M., 2004. Tables of X-Ray Mass Attenuation Coefficients and Mass Energy-Absorption Coefficients (version 1.4). http://physics.nist.gov/xaamdi (2005-08-09). National Institute of Standards and Technology, Gaithersburg, MD. } \keyword{datasets} RCarb/man/write_InputTemplate.Rd0000644000175000017500000000263514203705615016455 0ustar nileshnilesh% Generated by roxygen2: do not edit by hand % Please edit documentation in R/write_InputTemplate.R \name{write_InputTemplate} \alias{write_InputTemplate} \title{Write table input template} \usage{ write_InputTemplate(file = NULL, ...) } \arguments{ \item{file}{\link{character} (optional): output path, if \code{NULL} nothing is written, but a template \link{data.frame} is returned.} \item{...}{additional arguments that can be passed to function \link{write.table} if \code{file != NULL}. Supported arguments are: \code{sep}, \code{dec}, \code{fileEncoding}} } \description{ This function creates a template table that can be used as input for the function \link{model_DoseRate} } \section{Function version}{ 0.1.0 } \examples{ ##create template without file creation write_InputTemplate() \dontrun{ ##Example with file output ## set temporary filename ## (replace by own path if needed) temp_file <- tempfile(pattern = "template", fileext = ".csv") write_InputTemplate(file = temp_file) } } \seealso{ \link{Example_Data}, \link{write.table} } \author{ Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom) } \section{How to cite}{ Kreutzer, S., 2022. write_InputTemplate(): Write table input template. Function version 0.1.0. In: Kreutzer, S., Nathan, R.P., Mauz, B., 2022. RCarb: Dose Rate Modelling of Carbonate-Rich Samples . R package version 0.1.5. https://r-lum.github.io/RCarb/ } RCarb/man/Example_Data.Rd0000644000175000017500000000255614203705615014776 0ustar nileshnilesh% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RCarb-package.R \docType{data} \name{Example_Data} \alias{Example_Data} \title{Example data} \format{ \code{Example_Data}: \link{data.frame} (28 x 29) Each column has two attributes: \itemize{ \item \code{UNIT}: the unit, so far applicable, e.g. "ppm" \item \code{DESCRIPTION}: the column description } } \description{ Example data as shipped with \emph{Carb} by Mauz \& Hoffmann (2014). In contrast to the original data, \code{NA} values have been replaced by 0 and columns and rows have been transposed. Samples are now organised in rows and parameters in columns. The data can be used to test \code{'RCarb'} and play with the secondary carbonatisation process. Sample HD107 was renamed to LV107 for the sake of consistency with Fig. 4 in Mauz \& Hoffmann (2014). } \section{Version}{ 0.1.0 } \examples{ ## show first elements of the example data data(Example_Data, envir = environment()) head(Example_Data) ##show only column U230 Example_Data$U238 } \references{ Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the dose rate of carbonate-rich samples. Ancient TL 32, 24-32. } \author{ Mauz \& Hoffmann (2014), with minor modifications by Sebastian Kreutzer,Geography & Earth Sciences, Aberystwyth University (United Kingdom) } \keyword{datasets} RCarb/man/RCarb-package.Rd0000644000175000017500000000347214203705615015032 0ustar nileshnilesh% Generated by roxygen2: do not edit by hand % Please edit documentation in R/RCarb-package.R \docType{package} \name{RCarb-package} \alias{RCarb-package} \alias{RCarb} \title{RCarb - Dose Rate Modelling of Carbonate-Rich Samples} \description{ The package provides a dose rate modelling for carbonate-rich samples in the context of trapped charged dating (e.g., luminescence dating) applications. \if{html}{ \figure{Logo_RCarb.svg}{options: width="50" alt="https://github.com/R-Lum/RCarb"}\cr } } \details{ \strong{Funding} \itemize{ \item Between 2018-2019, the work of Sebastian Kreutzer as maintainer of the package was supported by LabEx LaScArBxSK (ANR - n. ANR-10-LABX-52). \item From 2020, Sebastian Kreutzer received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 844457 (project: CREDit). } } \references{ Kreutzer, S., Mauz, B., Martin, L., Mercier, N., 2019. “RCarb”: Dose Rate Modelling of Carbonate-Rich Samples - an Implementation of Carb in R -. Ancient TL 37, 1–8. This package bases on a 'MATLAB' programme with name 'Carb', details can be found the following references:\cr Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the dose rate of carbonate-rich samples. Ancient TL 32, 24-32. \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} \strong{Further reading} Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421} } \keyword{package} RCarb/man/figures/0000755000175000017500000000000014203705624013617 5ustar nileshnileshRCarb/man/figures/README-unnamed-chunk-2-1.png0000644000175000017500000012336313406151434020320 0ustar nileshnileshPNG  IHDRz4iCCPkCGColorSpaceGenericRGB8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2s=+WQ+]L6O w[C{_F qb Uvz?Zb1@/zcs>~if,ӈUSjF 1_Mjbuݠpamhmçϙ>a\+5%QKFkm}ۖ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Carb/man/model_DoseRate.Rd0000644000175000017500000001230214203705615015326 0ustar nileshnilesh% Generated by roxygen2: do not edit by hand % Please edit documentation in R/model_DoseRate.R \name{model_DoseRate} \alias{model_DoseRate} \title{Model dose rate evolution in carbonate-rich samples} \usage{ model_DoseRate( data, DR_conv_factors = NULL, length_step = 1L, max_time = 500L, n.MC = 100, method_control = list(), txtProgressBar = TRUE, verbose = TRUE, plot = TRUE, par_local = TRUE, ... ) } \arguments{ \item{data}{\link{data.frame} (\strong{required}): input data following the structure given in the example data set \code{data(Example_Data)}. The input \link{data.frame} should have at least one row (i.e. values for one sample). For multiple rows the function is automatically re-called.} \item{DR_conv_factors}{\link{character} (\emph{optional}): applied dose rate conversion factors, allowed input values are \code{"Carb2007"}, \code{"Adamiec_Aitken_1998"}, \code{"Guerin_et_al_2011"}, \code{"Liritzis_et_al_2013"}. \code{NULL} triggers the default, which is \code{"Carb2007"}} \item{length_step}{\link{numeric} (with default): step length used for the calculation} \item{max_time}{\link{numeric} (with default): maximum temporal search range} \item{n.MC}{\link{numeric} (with default): number of Monte Carlo runs used for the error calculation} \item{method_control}{(\emph{optional}): additional arguments that can be provided to the control the the modelling. See details for further information.} \item{txtProgressBar}{\link{logical} (with default): enables/disables the \code{txtProgressBar} for the MC runs} \item{verbose}{\link{logical} (with default): enables/disables verbose mode} \item{plot}{\link{logical} (with default): enables/disables plot output} \item{par_local}{\link{logical} (with default): enables/disable local par settings, If set to \code{FALSE} all global par settings are accepted.} \item{...}{further arguments passed to the underlying plot functions, see also details for further information. Supported standard arguments are \code{mfrow}, \code{xlim}, \code{xlab}.} } \value{ The function returns numerical and graphical output -----------------------------------\cr \verb{[ NUMERICAL OUTPUT ]}\cr -----------------------------------\cr \itemize{ \item A \link{data.frame} which is the combination of the input and values calculated by this function. } -----------------------------------\cr \verb{[ GRAPHICAL OUTPUT ]}\cr -----------------------------------\cr \strong{Upper plot:} Dose rate evolution over time backwards. The solid black line is the calculation output, the grey shaded area indicates the 2-sigma error margins. The dashed blue line is an indicator of the quality of the error estimations based on Monte Carlo (MC) runs.The closer it follows the black line, the more reliable are the given error margins. \cr \strong{Lower plot:} Totally absorbed dose over time. The plot is an representation of the 'new' age based on the carbonate modelling. } \description{ This function models the dose rate evolution in carbonate enrich environments. For the calculation internal functions are called. } \details{ This function is the starting point for the dose rate modelling for carbonate enrich environments. It provides basically the same functionality as the original version of \code{'Carb'}, i.e. you should be also aware of the limitations of this modelling approach. In particular: The model assumes a linear carbonate mass increase due to post-depositional processes. Please read the references cited blow.\cr \strong{Uncertainty estimation} For estimating the uncertainties, Monte-Carlo (MC) simulation runs are used. For very small values (close to 0) this can, however, lead to edge effects (similar in \code{'Carb'}) since values below 0 are set to 0. } \section{Function version}{ 0.2.1 } \examples{ ##load example data data("Example_Data", envir = environment()) ##run the function for one sample from ##the dataset model_DoseRate( data = Example_Data[14,], n.MC = 2, txtProgressBar = FALSE ) } \section{How to cite}{ Kreutzer, S., 2022. model_DoseRate(): Model dose rate evolution in carbonate-rich samples. Function version 0.2.1. In: Kreutzer, S., Nathan, R.P., Mauz, B., 2022. RCarb: Dose Rate Modelling of Carbonate-Rich Samples . R package version 0.1.5. https://r-lum.github.io/RCarb/ } \references{ Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the dose rate of carbonate-rich samples. Ancient TL 32, 24-32. \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} \cr \strong{Further reading} Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421} Zimmerman, D.W., 1971. Thermoluminescent dating using fine grains from pottery. Archaeometry 13, 29–52.\doi{10.1111/j.1475-4754.1971.tb00028.x} } \author{ Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom); based on 'MATLAB' code given in file Carb_2007a.m of \emph{Carb} } \keyword{dplot} \keyword{manip} RCarb/vignettes/0000755000175000017500000000000014203705624013410 5ustar nileshnileshRCarb/vignettes/GetStarted.html.asis0000644000175000017500000000023213355136342017301 0ustar nileshnilesh%\VignetteIndexEntry{Get started with RCarb} %\VignetteEngine{R.rsp::asis} %\VignetteKeyword{HTML} %\VignetteKeyword{vignette} %\VignetteKeyword{package} RCarb/vignettes/GetStarted.Rmd0000644000175000017500000001432714203704475016134 0ustar nileshnilesh--- title: "Get started with RCarb" author: "Sebastian Kreutzer1,2 & Barbara Mauz3" date: "Last modified: `r Sys.Date()` ('RCarb' version: `r packageVersion('RCarb')`)" output: rmarkdown::html_vignette: self-contained: yes toc: yes toc_depth: 4 number_sections: yes standalone: yes vignette: > %\VignetteEncoding{UTF-8} --- 1Geography & Earth Science, Aberystwyth University (United Kingdom)
2Archéosciences Bordeaux, UMR 6034, CNRS-Université Bordeaux Montaigne (France)
3Department of Geography and Geology, University of Salzburg, Salzburg (Austria)" ```{r, echo = FALSE, fig.align='center', out.width=100} knitr::include_graphics("../man/figures/Logo_RCarb.svg") ``` # Scope Getting started with a new **R** package can be a very tedious business (if not to say annoying). This document was written with the intention to make your first steps as painless as possible. # Quick start with the example dataset If you have no idea what a function does and how it works, it is always a good idea to have a closer look into the example sections of the package functions. The package `'RCarb'` has one central function named `model_DoseRate()`. The example given in the example section in the manual will be used in the following to illustrate the central package functionality in three steps. ## Load 'RCarb' ```{r} library(RCarb) ``` ## Load example data ```{r} ##load example data data("Example_Data", envir = environment()) ``` To get a first impression on how the example dataset looks like, you call the function `head()` to print the first five rows of a `data.frame` on the terminal. ```{r} head(Example_Data) ``` Unfortunately, the naming of the table columns is not straightforward to understand. The good news is that each column carries additional information that can be seen in the **R** terminal by typing, e.g., for the column 'K' (which is the 2nd column): ```{r} attributes(Example_Data$K) ``` It reveals that the numbers in the column correspond to the potassium concentration and are given in '%'. Similar all other columns can be inspected. And here the full overview ```{r, echo=FALSE, message=FALSE} ##extract attributes attributes <- lapply(1:ncol(Example_Data), function(x) attributes(Example_Data[[x]])) attributes <- as.data.frame(data.table::rbindlist(attributes), stringAsFactors = FALSE) df <- cbind(COLUM = colnames(Example_Data), attributes) knitr::kable(df) ``` ## Run dose rate modelling Now we want to start the modelling using the data given for the first sample only. ```{r, fig.height=7, fig.width=5, fig.align='center'} ##extract only the first row data <- Example_Data[1,] ##run model results <- model_DoseRate( data = data, DR_conv_factors = "Carb2007", n.MC = 10, txtProgressBar = FALSE) ``` The function returns a terminal output along with two plots, which are mostly similar to the original graphical output provided by the 'MATLAB' program 'Carb'. In the example above the function `model_DoseRate()` was called with three additional arguments, `DR_conv_factors = "Carb2007"`, `n.MC = 10`, `txtProgressBar = FALSE`. The first argument selects the dose rate conversion factors used by 'RCarb'. The second argument limits the number of Monte Carlo runs for the error estimation to 10 and the second argument prevents the plotting of the progress bar, indicating the progression of the calculation. Both arguments were solely set to reduce calculation time and output in this vignette. Obviously, you do not want to run each row in the input table separately to model all dose rates, so to run all the modelling for all samples in the example dataset you can call the model without subsetting the dataset first. **Be careful, the calculation may take some time**. ```{r, eval = FALSE} results <- model_DoseRate( data = Example_Data) ``` *A note on the used dose rate conversion factors: For historical reasons 'Carb' has its own set of dose rate conversion factors, which differ slightly from values in the literature (e.g., Adamiec \& Atiken, 1998) and are used in `'RCarb'` as default values. However, with `'RCarb' >= 0.1.3` you can select other dose rate conversion factors. Please type `?RCarb::Reference_Data` in your **R** terminal for further details.* # Using your own dataset Running only the example dataset is somewhat dissatisfactory, and the usual case will be that you provide your own dataset as input. While you can enter all data directly using R, the package offers another way, using external spreadsheet software such as 'Libre Office' (or, of course, MS Excel). The procedure is sketched in the following. ## Create template table The function `write_InputTemplate()` was written to create a template table (a CSV-file) that can be subsequently opened and filled. Using the function ensures that your input data have the correct structure, e.g., the correct number for columns and column names. ```{r} write_InputTemplate(file = "files/RCarb_Input.csv") ``` The path given with the argument `file` can be modified as needed. ## Enter own data & back import into R Own data are added using an external spreadsheet program and then save again as CSV-file. ```{r, fig.align='center', echo = FALSE, out.width = "400px"} knitr::include_graphics(path = "files/Screenshot.png") ``` For re-importing, the data standard R functionality can be used. ```{r} data <- read.csv(file = "files/RCarb_Input.csv") ``` ## Model the dose rate The final modelling does not differ from the call already show above (here without a plot output): ```{r, fig.height=7, fig.width=6, fig.align='center'} ##run model results <- model_DoseRate( data = data, n.MC = 10, txtProgressBar = FALSE, plot = FALSE) ``` # I don't like R Well, then you are wrong here. However, if you are just tired of using the **R** terminal and you want to have a graphical user interface to interact with 'RCarb'? Surprise: We also spent countless hours to develop a shiny application called 'RCarb app', and we ship it as part of the **R** package ['RLumShiny'](https://CRAN.R-project.org/package=RLumShiny). ## References {-} Adamiec, G., Aitken, M.J., 1998. Dose-rate conversion factors: update. Ancient TL 16, 37–50. http://ancienttl.org/ATL_16-2_1998/ATL_16-2_Adamiec_p37-50.pdf RCarb/build/0000755000175000017500000000000014203705624012477 5ustar nileshnileshRCarb/build/vignette.rds0000644000175000017500000000035314203705624015037 0ustar nileshnileshePۊ@ z~A¢ 냯F;XL7\7@2)*hlZ߬ T&QJ,B3bLXTԔ1@} & N7s8܎ybޯ!l\~9+ZyOޙ<Gi9]s?vmծ9[osgd7ePț 5 tQ+W"P^l5+H_ѽ]/U&߂XBநޠO痪*AKBSTtG r3RkUŴHiX FNU nl\&U+t8\\U RMFj&EFM3TL3?% Vf];T=sɛ^d" c/'A$)"1vD}XI.bUsb5` ݏ=ҡbl:3))NDnȺsu8u{*]՜jc%S6kbzQ`-N". [0-UՆM11nbGüRXb%ӷN(G@,1龯DeX'ڠ@w+aw1t%N38520di `c71z(۱LW qr'Z.!/8.\f#%QkѰ$w7ɏ(#7UgMU R/)95zEuEM6}Km8T6ɚBA0d_ڍzݴU ZŇ,#]cve+3/iddAFP"ϥo~(b _Rlrv!Lbgd2k( XjY^]`3 ˬG@|6kZ+`-h{H"d*[4a &&Ќs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^O^xhOl=ڿȽU3FM3T ksQ$6dEz}pZI_ç'-RT::ɏQ5׿(dxױ͸BJ@є ?~q"Mx5 2~sfN DaƬN7o7Ӯ&s1l>qL&VL&\ɱxoޥCt/~Ey*{ ; nhmrzڥ=nV7'Wx]HO;,8j>hԿی8ǃf7QRFu!?"L~ G@,!W,8JS.bv4vQMurȖS%o w%Lֺ>24YnkY̯ ؀H/GV2kdx~zin0xͩf\Wa9RB\6QP,c;@]@Dz2U9)"^/ %p 7itQh?"89 ) bPH`[J5R|8oC@z 6>"ڤ&Z=H?vamClvM~ϹMGgxՖ;GVj[&]*vRCarb/tests/0000755000175000017500000000000013372276013012543 5ustar nileshnileshRCarb/tests/testthat/0000755000175000017500000000000014204520032014367 5ustar nileshnileshRCarb/tests/testthat/test_model_DoseRate.R0000644000175000017500000000450413763715562020471 0ustar nileshnileshtest_that("Full function test", { testthat::skip_on_cran() local_edition(3) ##load Example dataset data("Example_Data", envir = environment()) ##break function expect_error(model_DoseRate(data = "test"), regexp = "'data' is not a 'data.frame'") expect_error(model_DoseRate(data = data.frame(x = 1)), regexp = "The column names of your input data.frame do not match the requirements.") expect_error(model_DoseRate(data = data.frame()), regexp = "'data' is empty!") expect_error(suppressWarnings(model_DoseRate(data = data.frame(x = NA)), regexp = "'data' is empty!")) expect_error( suppressWarnings(model_DoseRate(data = Example_Data[23,], n.MC = 10)), regexp = "Modelling failed, please check your input data, they may not be meaningful!") expect_type(suppressWarnings(model_DoseRate( data = Example_Data[23:24, ], n.MC = 10, verbose = FALSE )), type = "list") expect_error(suppressWarnings(model_DoseRate(data = Example_Data[14,], DR_conv_factors = "error", n.MC = 2, txtProgressBar = FALSE )), regexp = "'error' does not correspond to an available dose rate conversion dataset.\n Allowed are: Carb2007, Adamiec_Aitken_1998, Guerin_et_al_2011, Liritzis_et_al_2013") ##run simple example expect_type(suppressWarnings(model_DoseRate(data = Example_Data[14,], n.MC = 2, txtProgressBar = FALSE )), type = "list") ##run with different conversion factors expect_type( suppressWarnings(model_DoseRate( data = Example_Data[14, ], DR_conv_factors = "Adamiec_Aitken_1998", n.MC = 2, txtProgressBar = FALSE )), type = "list" ) ##run extreme case warning temp <- Example_Data[14, ] temp$DE <- 550 ##TODO the warning appears 16 times ... to much # expect_warning( # model_DoseRate( # data = temp, # n.MC = 2, # txtProgressBar = FALSE # ), # regexp = "\\[\\.calc_DoseRate\\(\\)\\] Extrem case detected: DE > max cumulative dose rate!" # ) ##run two example expect_type(model_DoseRate( data = Example_Data[13:14, ], n.MC = 5, txtProgressBar = TRUE ), type = "list") ##run with n.MC == 1 expect_type(model_DoseRate( data = Example_Data[14, ], n.MC = 1, txtProgressBar = FALSE ), type = "list") }) RCarb/tests/testthat/test_write_InputTemplate.R0000644000175000017500000000035613763715606021610 0ustar nileshnileshtest_that("Full function test", { testthat::skip_on_cran() local_edition(3) ##simple run expect_type(write_InputTemplate(), type = "list") ##write on template folder expect_silent(write_InputTemplate(file = tempfile())) })RCarb/tests/testthat/test_.cal_DoseRate.R0000644000175000017500000000047213763713714020203 0ustar nileshnileshtest_that("Full function test", { testthat::skip_on_cran() local_edition(3) ##load Example dataset data("Example_Data", envir = environment()) ##simple run to check the 'ref' fall back expect_type(RCarb:::.calc_DoseRate(x = 10, data = Example_Data[14, ], ref = NULL), type = "list") })RCarb/tests/testthat.R0000644000175000017500000000006513372276001014524 0ustar nileshnileshlibrary(testthat) library(RCarb) test_check("RCarb")RCarb/R/0000755000175000017500000000000013361410610011571 5ustar nileshnileshRCarb/R/RCarb-package.R0000644000175000017500000002311714203703636014313 0ustar nileshnilesh#' @title RCarb - Dose Rate Modelling of Carbonate-Rich Samples #' #' @description The package provides a dose rate modelling for carbonate-rich samples in the #' context of trapped charged dating (e.g., luminescence dating) applications. #' #' #' \if{html}{ #' \figure{Logo_RCarb.svg}{options: width="50" alt="https://github.com/R-Lum/RCarb"}\cr #' } #' #' #' @details #' #' **Funding** #' #' * Between 2018-2019, the work of Sebastian Kreutzer as maintainer of the package was supported #' by LabEx LaScArBxSK (ANR - n. ANR-10-LABX-52). #' #' * From 2020, Sebastian Kreutzer received funding from the European Union’s Horizon 2020 #' research and innovation programme under the Marie Skłodowska-Curie grant agreement #' No 844457 (project: CREDit). #' #' @name RCarb-package #' #' @aliases RCarb-package RCarb #' #' @docType package #' #' @keywords package #' #' @import utils #' #' #' @references #' #' Kreutzer, S., Mauz, B., Martin, L., Mercier, N., 2019. “RCarb”: #' Dose Rate Modelling of Carbonate-Rich Samples - an Implementation of Carb in R -. #' Ancient TL 37, 1–8. #' #' This package bases on a 'MATLAB' programme with name 'Carb', details can be found the #' following references:\cr #' #' Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the #' dose rate of carbonate-rich samples. Ancient TL 32, 24-32. \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} #' #' Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. #' Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} #' #' **Further reading** #' #' Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. #' DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421} #' #' @importFrom grDevices rgb #' @importFrom graphics plot plot.default abline lines par mtext polygon points axis text #' @importFrom stats approx nlminb rnorm sd na.exclude density #' #' @md NULL #' Example data #' #' @name Example_Data #' #' @description #' Example data as shipped with *Carb* by Mauz \& Hoffmann (2014). In contrast to the original #' data, `NA` values have been replaced by 0 and columns and rows have been transposed. Samples #' are now organised in rows and parameters in columns. #' #' The data can be used to test `'RCarb'` and play with the secondary carbonatisation process. #' Sample HD107 was renamed to LV107 for the sake of consistency with Fig. 4 in Mauz \& Hoffmann (2014). #' #' #' @format #' #' `Example_Data`: [data.frame] (28 x 29) #' #' Each column has two attributes: #' #' - `UNIT`: the unit, so far applicable, e.g. "ppm" #' - `DESCRIPTION`: the column description #' #' @section Version: 0.1.0 #' #' @keywords datasets #' #' @author Mauz \& Hoffmann (2014), with minor modifications by Sebastian Kreutzer,Geography & Earth #' Sciences, Aberystwyth University (United Kingdom) #' #' #' @references #' #' Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model #' for estimating the dose rate of carbonate-rich samples. Ancient TL 32, 24-32. #' #' @examples #' #' ## show first elements of the example data #' data(Example_Data, envir = environment()) #' head(Example_Data) #' #' ##show only column U230 #' Example_Data$U238 #' #' @docType data #' @md NULL #' Reference data #' #' @name Reference_Data #' #' @description Reference data and correction factors for beta and gamma radiation used for internal calculations. #' These values are used instead of the correction factors given in Aitken (1985) for the carbonate model. #' #' @details The reference values are used internally to account for: (1) grain size depend beta-attenuation #' factors (Mejdahl, 1979) and (2) to correct nuclide dependent beta and gamma radiation for water/carbonate proportions. #' The latter values are given as matrix and precise values are interpolated during the modelling process. #' #' Additionally 'RCarb' provides and own set of dose rate conversion factors to convert concentrations #' of U, Th, and K to dose rate values. Historically *Carb* (and thus 'RCarb') as its own dose rate #' conversion factors, which differ slightly from other published values. To provide a consistent #' calculation approach by default the 'old' *Carb* values are used, but the user can further #' switch (see [model_DoseRate]) to values provided by Adamiec \& Aitken (1998), Guérin et al. (2011) #' or Liritzis et al (2013). #' #' Different values quoted for U-238 and U-234 accounts for different activity ratios. For further details #' on the origin of these data we refer to Nathan \& Mauz (2008) and Nathan (2010).\cr #' #' **Nuclear data origin according to Nathan \& Mauz (2008)** #' #' The gamma primary energy spectra of uranium, thorium and potassium are drawn from #' Evaluated Nuclear Structure Data File (ENSDF) database at \url{http://www.nndc.bnl.gov} (2002-01-16) #' and the beta primary energy spectra was derived from ENSDF end-point energies using a #' Fermi beta decay model (Evans, 1955) modified by Behrens \& Szybisz (1976). #' For the simulations of the collisional mass stopping powers for quartz the software ESTAR #' (Berger et al., 2000) was used. The mass energy-absorption coefficients for quartz were #' tabulated by Hubbell \& Seltzer (2004). #' #' *For further details and references please read Nathan \& Mauz (2008)* #' #' #' @format #' #' `Reference_Data`: [list] \cr #' #' \tabular{llll}{ #' **NAME** \tab **TYPE** \tab **DIM** \tab **DESCRIPTION**\cr #' `DATAek` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for K\cr #' `DATAet` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for Th \cr #' `DATAet230` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for Th-230\cr #' `DATAeu` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U\cr #' `DATAeu234` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U-234\cr #' `DATAeu238` \tab `matrix` \tab 4 x 4 \tab correction factors for electrons for water and carbonate to sediment mass ratio for U-238\cr #' `DATApk` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for K\cr #' `DATApt` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for T\cr #' `DATApt230` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for Th-230\cr #' `DATApu` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U\cr #' `DATApu234` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U-234\cr #' `DATApu238` \tab `matrix` \tab 4 x 4 \tab correction factors for photons for water and carbonate to sediment mass ratio for U-238\cr #' `mejdahl` \tab `data.frame` \tab 36 x 4 \tab beta-dose attenuation values for quartz grains according to Mejdahl (1979) \cr #' `DR_conv_factors` \tab `data.frame` \tab 4 x 13 \tab beta and gamma dose rate conversion factors used internally (see details) #' } #' #' @section Version: 0.2.0 #' #' @keywords datasets #' #' @references #' #' Adamiec, G., Aitken, M.J., 1998. Dose-rate conversion factors: update. #' Ancient TL 16, 37–50. \url{http://ancienttl.org/ATL_16-2_1998/ATL_16-2_Adamiec_p37-50.pdf} #' #' Guérin, G., Mercier, N., Adamiec, G., 2011. Dose-rate conversion factors: update. Ancient TL 29, 5–9. #' \url{http://ancienttl.org/ATL_29-1_2011/ATL_29-1_Guerin_p5-8.pdf} #' #' Liritzis, I., Stamoulis, K., Papachristodoulou, C., Ioannides, K., 2013. #' A Re-Evaluation of Radiation Dose-Rate Conversion Factors. #' Mediterranean Archaeology and Archaeometry 12, 1–15. #' \url{http://maajournal.com/Issues/2012/pdf/FullTextLiritzis.pdf} #' #' Mejdahl, V., 1979. Thermoluminescence dating: beta-dose attenuation in quartz grains. Archaeometry 21, 61-72. #' \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} #' #' Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. #' Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} #' #' Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. #' DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421}\cr #' #' **Further reading** #' #' Aitken, M.J., 1985. Thermoluminescence dating. Academic Press. #' #' Berger, M.J., Coursey, J.S., Zucker, M.A., 2000. ESTAR, PSTAR, and #' ASTAR: Computer Programs for Calculating Stopping-Power and Range #' Tables for Electrons, Protons, and Helium Ions (version 1.2.2). #' http://physics.nist.gov/Star (2005-08-09). #' National Institute of Standards and Technology, Gaithersburg, MD. #' #' Behrens, H., Szybisz, L., 1976. Shapes of beta spectra. Physics Data 6-1, #' Zentralstelle fuer Atomkernenergie-Dokumentation (ZAED), Germany. #' #' Evans, R.D., 1955. The Atomic Nucleus. McGraw-Hill, NY. #' #' Hubbell, J.H., Seltzer, S.M., 2004. Tables of X-Ray Mass Attenuation Coefficients and Mass #' Energy-Absorption Coefficients (version 1.4). http://physics.nist.gov/xaamdi #' (2005-08-09). National Institute of Standards and Technology, Gaithersburg, MD. #' #' #' @examples #' #' data(Reference_Data, envir = environment()) #' str(Reference_Data) #' Reference_Data$DATAek #' #' @docType data #' @md NULLRCarb/R/calc_DoseRate.R0000644000175000017500000002743513730104635014426 0ustar nileshnilesh#' @title Internal function to calculate date for a given maximum time #' #' @description This is the real worker function based on the *Carb* MATLAB function `'datalu1.m'`. To #' avoid overhead, the function does not double check the input parameters and is thus not exposed #' and it does not appear in the manual #' #' @param x [numeric] (**required**): time for which the scenario is calculated #' #' @param data [data.frame] (**required**): input data, only a data.frame is allowed #' #' @param DR_conv_factors [character] (*optional*): select dose rate conversion factors, `NULL` #' uses the original *Carb* values #' #' @param ref [list] (**optional**): list of reference data provided with this package, if nothing #' is provided the function will load package reference data via `data("Reference_Data", envir = environment())`. #' #' @param length_step [numeric] (with default): step length used for the calculation #' #' @param max_time [numeric] (with default): maximum time span to be evaluated #' #' @param mode_optim [logical] (with default): switch output mode, if `TRUE` only a scalar is returned, #' this reduces the used memory consumption for the calculation #' #' @author Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom) based #' on the MATLAB code in the file `'datalu1.m'` from `Carb_2007a` #' #' @section Function version: 0.2.0 #' #' @example #' ## the function can be run manually, however, this is not recommended, example: #' data("Example_Data", envir = environment()) #' RCarb:::.calc_DoseRate( #' x = 10, #' data = Example_Data[14,] #' ) #' #' @md #' @noRd .calc_DoseRate <- function( x, data, DR_conv_factors = NULL, ref = NULL, length_step = 1, max_time = 500, mode_optim = FALSE ){ ## load reference data if needed; we should try to load them externally before, ## however if this function is run internally for tests we want to have ## the comfort if(is.null(ref)){ Reference_Data <- NULL data("Reference_Data", envir = environment()) ref <- Reference_Data rm(Reference_Data) } ##rewrite variables, to keep the naming consistent with the original MATLAB code TIMEMAX <- x STEP1 <- length_step[1] ##initialise dose rate conversion factors (error catching we do a level up) if(is.null(DR_conv_factors)){ DR_ID <- 1 }else{ DR_ID <- grep( x = ref[["DR_conv_factors"]][["REFERENCE"]], pattern = DR_conv_factors, fixed = TRUE) } handles.UB <- ref[["DR_conv_factors"]][["UB"]][DR_ID] handles.TB <- ref[["DR_conv_factors"]][["TB"]][DR_ID] handles.KB <- ref[["DR_conv_factors"]][["KB"]][DR_ID] handles.UG <- ref[["DR_conv_factors"]][["UG"]][DR_ID] handles.TG <- ref[["DR_conv_factors"]][["TG"]][DR_ID] handles.KG <- ref[["DR_conv_factors"]][["KG"]][DR_ID] # STEP 1: Find U, Th, K values for the sediment ----------------------------------------------- ##transfer U, Th, and K value KA <- data[["K"]] UA <- data[["U"]] TA <- data[["T"]] K <- KA * (1 + data[["CC"]] / 100) U <- UA * (1 + data[["CC"]] / 100) T <- TA * (1 + data[["CC"]] / 100) # STEP 2: Derive carbonate model (daterlu1.m) ------------------------------------------------- ##2.1. - create vectors with variables, the maxium length is determined by max_time ##C >> CARBONATE C <- c( rep(1, data[["FINISH"]] / STEP1) * data[["CC"]] / 100, seq(data[["CC"]] / 100, 1e-05, length.out = (data[["ONSET"]] - data[["FINISH"]]) / STEP1 + 1), rep(0, (max_time - data[["ONSET"]]) / STEP1) + 1e-05 ) ##WC >> WATER CONTENT WC <- c( rep(1, data[["FINISH"]] / STEP1) * data[["WCF"]] / 100, seq(data[["WCF"]] / 100, data[["WCI"]] / 100, length.out = (data[["ONSET"]] - data[["FINISH"]]) / STEP1 + 1), rep(0, (max_time - data[["ONSET"]]) / STEP1) + data[["WCI"]] / 100 ) ##2.2. - create additional objects WF <- C + WC WFA <- data[["WCF"]] / 100 LEN <- length(C) ##2.3 - create time matrix TIME <- matrix(seq(0, max_time, STEP1), nrow = 1) TIME_ <- seq(0,round(TIMEMAX * STEP1)/STEP1) TIME_ <- c(rep(0,max_time - max(TIME_)), TIME_) # STEP 3: Derive linear uptake mode of uranium (code from Forbes Quarry work) (daterlu1.m) --------- lam_u235 <- log(2) / 703800000 lam_u238 <- log(2) / 4.4680e+09 ##combine in matrix Aa <- .rad_pop_LU(data[["U234_U238"]], TIME_) ##flip matrix row order Aa <- apply(Aa, 2, rev) ##note: the MATLAB code now throws all variables, ##namely, "N_u238", "N_u234", "N_t230", "N_u235", "N_p231" ##Of course we do not do this here, since this is an R package and the last thing ##we want to have is a package writting unexpectedly into the Global Environment ##In the following the objects are accessed by accessing the matrix ## Parent activity (Bq/mg) ... from A&A (1998) A_u238 <- lam_u238 * 6.022e+023 * 1e-3 / (238 * 31.56e+06) A_u235 <- lam_u235 * 6.022e+23 * 1e-03 / (235 * 31.56e+06) ## dose rate per ppm of parent conv_const <- 5.056e-03 CONST_Q_U238 <- 0.9927 CONST_Q_U235 <- 1 - CONST_Q_U238 D_b_u238 <- conv_const * A_u238 * 0.8860 * CONST_Q_U238 D_b_u234 <- conv_const * A_u238 * 0.0120 * CONST_Q_U238 D_b_t230 <- conv_const * A_u238 * 1.3850 * CONST_Q_U238 D_b_u235 <- conv_const * A_u235 * 0.1860 * CONST_Q_U235 D_g_u238 <- conv_const * A_u238 * 0.0290 * CONST_Q_U238 D_g_u234 <- conv_const * A_u238 * 0.0020 * CONST_Q_U238 D_g_t230 <- conv_const * A_u238 * 1.7430 * CONST_Q_U238 ## i-m dose rate - no grain size correction U238_b_diseq <- D_b_u238 * Aa[,"N_u238"] * data[["U238"]] U234_b_diseq <- D_b_u234 * Aa[,"N_u234"] * data[["U238"]] T230_b_diseq <- D_b_t230 * Aa[,"N_t230"] * data[["U238"]] U238_g_diseq <- D_g_u238 * Aa[,"N_u238"] * data[["U238"]] U234_g_diseq <- D_g_u234 * Aa[,"N_u234"] * data[["U238"]] T230_g_diseq <- D_g_t230 * Aa[,"N_t230"] * data[["U238"]] # STEP 4: Calculate time-dependent dose rate -------------------------------------------------- ##this step uses the data by Mejdahl and interpolates the value for the given diamter MK <- 1 - exp( approx(x = log(ref$mejdahl[[1]]), y = log(ref$mejdahl[[2]]), xout = log(data[["DIAM"]]/1000), rule = 2)$y) MT <- 1 - exp( approx(x = log(ref$mejdahl[[1]]), y = log(ref$mejdahl[[3]]), xout = log(data[["DIAM"]]/1000), rule = 2)$y) MU <- 1 - exp( approx(x = log(ref$mejdahl[[1]]), y = log(ref$mejdahl[[4]]), xout = log(data[["DIAM"]]/1000), rule = 2)$y) MU238 <- MU234 <- MT230 <- MU235 <- MP231 <- 1 ##prepare data, to avoid that this is called over and over again when .griddata is called x_grid <- as.numeric(colnames(ref$DATAek)) y_grid <- x_grid x_grid <- log(rep(x_grid, length(x_grid))) y_grid <- log(rep(y_grid, each = length(y_grid))) xo <- log(WC) yo <- log(C) ##run surface interpolation calculations to get the ##water correction factors ##nomenclature: ## ++++++++++++++++ RCarb calculation ++++++++++++++++++++++++ ##beta water correction factors XKB <- .griddata(x_grid, y_grid, ref$DATAek, xo, yo) XTB <- .griddata(x_grid, y_grid, ref$DATAet, xo, yo) XUB <- .griddata(x_grid, y_grid, ref$DATAeu, xo, yo) XU238B <- .griddata(x_grid, y_grid, ref$DATAeu238, xo, yo) XU234B <- .griddata(x_grid, y_grid, ref$DATAeu234, xo, yo) XT230B <- .griddata(x_grid, y_grid, ref$DATAet230, xo, yo) ##gamma water correction factors XKG <- .griddata(x_grid, y_grid, ref$DATApk, xo, yo) XTG <- .griddata(x_grid, y_grid, ref$DATApt, xo, yo) XUG <- .griddata(x_grid, y_grid, ref$DATApu, xo, yo) XU238G <- .griddata(x_grid, y_grid, ref$DATApu238, xo, yo) XU234G <- .griddata(x_grid, y_grid, ref$DATApu234, xo, yo) XT230G <- .griddata(x_grid, y_grid, ref$DATApt230, xo, yo) ##perform dose rate correction with the before set factors ##beta water correction factors DRKB <- MK * K * handles.KB / (1 + XKB * WF) DRTB <- MT * T * handles.TB / (1 + XTB * WF) DRUB <- MU * U * handles.UB / (1 + XUB * WF) DRU238B <- MU238 * U238_b_diseq / (1 + XU238B * WF) DRU234B <- MU238 * U234_b_diseq / (1 + XU234B * WF) DRT230B <- MU238 * T230_b_diseq / (1 + XT230B * WF) ##gamma water corrections factors DRKG <- MK * K * handles.KG / (1 + XKG * WF) DRTG <- MT * T * handles.TG / (1 + XTG * WF) DRUG <- MU * U * handles.UG / (1 + XUG * WF) DRU238G <- MU238 * U238_g_diseq / (1 + XU238G * WF) DRU234G <- MU238 * U234_g_diseq / (1 + XU234G * WF) DRT230G <- MU238 * T230_g_diseq / (1 + XT230G * WF) ##calculate final dose rate DR <- DRKB + DRTB + DRUB + DRKG + DRTG + DRUG + data[["COSMIC"]] + data[["INTERNAL"]] + DRU238B + DRU234B + DRT230B + DRU238G + DRU234G + DRT230G ## ++++++++++++++++ Conventinal calculation ++++++++++++++++++++++++ ##set alternative, the commonly used water correction factors ##after Zimmerman, 1971 (Archaeometry); cf. also Aitken (1985) ##after no interpolation is needed since these factors remain constant XKBA <- XTBA <- XUBA <- XU238BA <- XU234BA <- XT230BA <- 1.25 XKGA <- XTGA <- XUGA <- XU238GA <- XU234GA <- XT230GA <- 1.14 ##beta DRKBA <- MK * KA * handles.KB / (1 + XKBA * WFA) DRTBA <- MT * TA * handles.TB / (1 + XTBA * WFA) DRUBA <- MU * UA * handles.UB / (1 + XUBA * WFA) DRU238BA <- MU238 * U238_b_diseq / (1 + XU238BA * WFA) DRU234BA <- MU238 * U234_b_diseq / (1 + XU234BA * WFA) DRT230BA <- MU238 * T230_b_diseq / (1 + XT230BA * WFA) ##gamma DRKGA <- MK * KA * handles.KG / (1 + XKGA * WFA) DRTGA <- MT * TA * handles.TG / (1 + XTGA * WFA) DRUGA <- MU * UA * handles.UG / (1 + XUGA * WFA) DRU238GA <- MU238 * U238_g_diseq / (1 + XU238GA * WFA) DRU234GA <- MU238 * U234_g_diseq / (1 + XU234GA * WFA) DRT230GA <- MU238 * T230_g_diseq / (1 + XT230GA * WFA) ##calculate alternative (conventional) dose rate DRA <- DRKBA + DRTBA + DRUBA + DRKGA + DRTGA + DRUGA + data[["COSMIC"]] + data[["INTERNAL"]] + DRU238BA + DRU234BA + DRT230BA + DRU238GA + DRU234GA + DRT230GA ##replace NA values by 0, otherwise the function crashes ##The NA values come from the surface (line 175) interpolation and replacing them by 0 ##does not affect the results, but allows the code to run without taking other precautions. DR[is.na(DR)] <- 0 DRA[is.na(DRA)] <- 0 # STEP 5: Calculate date ---------------------------------------------------------------------- ##calculate the cummulated absorbed dose ##Is this correct, starting from index 1? Yes, it is, we have set the maximum manually to ##500, if we would reverse the vector, we would pretend that we know the age of the sample ##already, but then we would not need this modelling. CUMDR <- cumsum(c(0, (DR[1:(length(DR) - 1)] + DR[2:length(DR)]) * STEP1 / 2)) CUMDRA <- cumsum(c(0, (DRA[1:(length(DRA) - 1)] + DRA[2:length(DRA)]) * STEP1 / 2)) if(data[["DE"]] > max(CUMDR)) ##modified before it was Age > 500 ka, which did not fit. warning("[.calc_DoseRate()] Extrem case detected: DE > max cumulative dose rate!", call. = FALSE) ##RCarb ages AGE <- try( approx(x = CUMDR, y = as.numeric(TIME), xout = data[["DE"]], method = "linear", rule = 2)$y, silent = TRUE) ##conventional age AGEA <- try( approx(x = CUMDRA, y = as.numeric(TIME), xout = data[["DE"]], method = "linear", rule = 2)$y, silent = TRUE) ##sometimes the input values are not meaningful (for example data row 23 in the example dataset) ##and the approximation failed, ##we here provide a clean crash if(class(AGE) == 'try-error' || class(AGEA) == 'try-error') stop("[.calc_DoseRate()] Modelling failed, please check your input data, they may not be meaningful!", call. = FALSE) ##calculate age ABS <- abs(AGE - TIMEMAX) # RETURN -------------------------------------------------------------------------------------- if(mode_optim){ results <- ABS }else{ results <- list( ABS = ABS, AGE = AGE, AGEA = AGEA, LEN = LEN, DR = DR, DRA = DRA, CUMDR = CUMDR, CUMDRA = CUMDRA ) } return(results) } RCarb/R/internals_RCarb.R0000644000175000017500000000670113730104727015001 0ustar nileshnilesh#################################################################################################### ## INTERNAL HELPER FUNCTIONS RCarb ## #################################################################################################### #+++++++++++++++++++++ #+ .rad_pop_LU() + #+++++++++++++++++++++ #' @title Calculate Ra population based in a given activity ratio and time #' #' @description This function is a direct translation from the Matlab function `rad_pop_LU` to R from the #' software `'Carb'` (version 2007a). The function is called from within the function [calc_DoseRate]. #' #' @author Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom); based on Matlab #' code provided by the authors of 'Carb' #' #' @param ACT_RATIO [numeric] (**required**): activity ratio (a scalar) #' #' @param t [numeric] (**required**): time for which the Ra populations is calculated #' #' @section Function version: 0.1.0 #' #' @return This function returns a [matrix] of dimension `length(t) x 4` #' #' @md #' @noRd .rad_pop_LU <- function( ACT_RATIO, t ){ a <- 1 / rev(t)[1] L234 <- log(2) / 2.455e+05 L235 <- log(2) / 7.038e+08 L238 <- log(2) / 4.468e+09 L230 <- log(2) / 7.538e+04 L231 <- log(2) / 3.276e+04 c <- ACT_RATIO * L238 / L234 U238 <- a * t b <- a U235 <- b * t P231 <- (b * L235 / L231^2) * (exp(-L231 * t) + L231 * t - 1) P231 <- P231 * (L231 / L235) U234 <- ((L238 * a / L234 ^ 2) - (a * c / L234)) * exp(-L234 * t) + (L238 * a / L234) * t + a * c / L234 - L238 * a / L234 ^ 2 U234 <- U234 * (L234/L238) T230 <- (L238 * a/(L234*(L230-L234)) - a*c/(L230-L234)) * exp(-L234 * t) + (a*c/(L230-L234) - L238*a/(L234*(L230-L234)) + L238*a/L230^2 + L238*a/(L230*L234) - a*c/L230 ) * exp(-L230 * t) + (L238*a/L230) * t + a*c/L230 - L238*a/(L230*L234) - L238*a/L230^2 T230 <- T230 * (L230 / L238) ##combine in matrix m <- matrix(c(U238, U234, T230, U235, P231), ncol = 5, byrow = FALSE) ##provide column headers (this helps later) colnames(m) <- c("N_u238", "N_u234", "N_t230", "N_u235", "N_p231") return(m) } #+++++++++++++++++++++ #+ .griddata() + #+++++++++++++++++++++ #' @title Point interpolation on for irregular surface data #' #' @description This function mimics the MATLAB function `'griddata'`, adapted for the specific #' problems in context of this package. Internally the function [interp::interpp] is used. Please #' note that this function should not be used outside of the context of this package. #' #' @return The function returns a vector with the interpolated values #' #' @param x [numeric] (**required**): vector of x-coordinates #' #' @param y [numeric] (**required**): vector of y-coordinates #' #' @param z [numeric] (**required**): vector of z-coordinates #' #' @param xo [numeric] (**required**): vector of x-coordinates for the output grid #' #' @param yo [numeric] (**required**): vector of y-coordinates for the output grid #' #' @param ... further arguments passed to [inter::interpp] #' #' @author Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom) #' #' @section Function version: 0.1.0 #' #' @seealso [interp::interpp], [calc_DoseRate] #' #'@md #'@noRd .griddata <- function(x_grid = x_grid, y_grid = y_grid, z, xo = xo, yo = yo, ...){ interp::interpp( x = x_grid, y = y_grid, z = as.numeric(z), xo = xo, yo = yo, ... )$z } RCarb/R/write_InputTemplate.R0000644000175000017500000000440313730105055015726 0ustar nileshnilesh#' @title Write table input template #' #' @description This function creates a template table that can be used as input for the function #' [model_DoseRate] #' #' @param file [character] (optional): output path, if `NULL` nothing is written, but a template #' [data.frame] is returned. #' #' @param ... additional arguments that can be passed to function [write.table] if `file != NULL`. #' Supported arguments are: `sep`, `dec`, `fileEncoding` #' #' @author Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom) #' #' @section Function version: 0.1.0 #' #' @examples #' #' ##create template without file creation #' write_InputTemplate() #' #' \dontrun{ #' ##Example with file output #' #' ## set temporary filename #' ## (replace by own path if needed) #' temp_file <- tempfile(pattern = "template", fileext = ".csv") #' write_InputTemplate(file = temp_file) #' #' } #' #' @seealso [Example_Data], [write.table] #' #' @md #' @export write_InputTemplate <- function( file = NULL, ... ){ ##load example data, this is our starting point Example_Data <- NULL data("Example_Data", envir = environment()) df <- Example_Data ##remove all rows, except the first df <- df[1,] ##replace name df$SAMP_NAME[1] <- "EXAMPLE" ##restore attributes df_list <- lapply(1:ncol(df), function(x){ attr.names <- names(attributes(Example_Data[[x]])) attributes(df[[x]])[attr.names] <- attributes(Example_Data[[x]])[attr.names] return(df[[x]]) }) ##restore names names(df_list) <- colnames(Example_Data) ##transform to data.frame df <- as.data.frame(df_list,stringsAsFactors = FALSE) attr(df, which = "pacakge") <- "RCarb" # Output -------------------------------------------------------------------------------------- if(is.null(file)){ return(df) }else{ ##allow some flexibility write_settings <- list( sep = ",", dec = ".", fileEncoding = "" ) ##modify if needed write_settings <- modifyList(x = write_settings, val = list(...)) ##write table write.table( x = df, file = file, append = FALSE, quote = FALSE, row.names = FALSE, col.names = TRUE, sep = write_settings$sep, fileEncoding = write_settings$fileEncoding ) } }RCarb/R/model_DoseRate.R0000644000175000017500000004457413730107416014627 0ustar nileshnilesh#' @title Model dose rate evolution in carbonate-rich samples #' #' @description This function models the dose rate evolution in carbonate enrich environments. For the #' calculation internal functions are called. #' #' @details This function is the starting point for the dose rate modelling for carbonate enrich #' environments. It provides basically the same functionality as the original version of `'Carb'`, i.e. #' you should be also aware of the limitations of this modelling approach. In particular: The model #' assumes a linear carbonate mass increase due to post-depositional processes. Please read the #' references cited blow.\cr #' #' **Uncertainty estimation** #' #' For estimating the uncertainties, Monte-Carlo (MC) simulation runs are used. For very #' small values (close to 0) this can, however, lead to edge effects (similar in `'Carb'`) since #' values below 0 are set to 0. #' #' @param data [data.frame] (**required**): input data following the structure given #' in the example data set `data(Example_Data)`. The input [data.frame] should have at least #' one row (i.e. values for one sample). For multiple rows the function is automatically re-called. #' #' @param DR_conv_factors [character] (*optional*): applied dose rate conversion factors, #' allowed input values are `"Carb2007"`, `"Adamiec_Aitken_1998"`, `"Guerin_et_al_2011"`, #' `"Liritzis_et_al_2013"`. `NULL` triggers the default, which is `"Carb2007"` #' #' @param length_step [numeric] (with default): step length used for the calculation #' #' @param max_time [numeric] (with default): maximum temporal search range #' #' @param n.MC [numeric] (with default): number of Monte Carlo runs used for the error calculation #' #' @param method_control (*optional*): additional arguments that can be provided to the control the #' the modelling. See details for further information. #' #' @param txtProgressBar [logical] (with default): enables/disables the `txtProgressBar` for the MC runs #' #' @param verbose [logical] (with default): enables/disables verbose mode #' #' @param plot [logical] (with default): enables/disables plot output #' #' @param par_local [logical] (with default): enables/disable local par settings, If set #' to `FALSE` all global par settings are accepted. #' #' @param ... further arguments passed to the underlying plot functions, see also details for further information. Supported standard arguments are `mfrow`, `xlim`, `xlab`. #' #' @return The function returns numerical and graphical output #' #' -----------------------------------\cr #' `[ NUMERICAL OUTPUT ]`\cr #' -----------------------------------\cr #' * A [data.frame] which is the combination of the input and values calculated by this function. #' #' -----------------------------------\cr #' `[ GRAPHICAL OUTPUT ]`\cr #' -----------------------------------\cr #' #' **Upper plot:** Dose rate evolution over time backwards. The solid black line is the calculation #' output, the grey shaded area indicates the 2-sigma error margins. The dashed blue line is an indicator #' of the quality of the error estimations based on Monte Carlo (MC) runs.The closer it follows the #' black line, the more reliable are the given error margins. \cr #' #' **Lower plot:** Totally absorbed dose over time. The plot is an representation of the 'new' #' age based on the carbonate modelling. #' #' #' @examples #' ##load example data #' data("Example_Data", envir = environment()) #' #' ##run the function for one sample from #' ##the dataset #' model_DoseRate( #' data = Example_Data[14,], #' n.MC = 2, #' txtProgressBar = FALSE #' ) #' #' #' @author Sebastian Kreutzer, Geography & Earth Sciences, Aberystwyth University (United Kingdom); based #' on 'MATLAB' code given in file Carb_2007a.m of *Carb* #' #' @section Function version: 0.2.1 #' #' @references #' Mauz, B., Hoffmann, D., 2014. What to do when carbonate replaced water: Carb, the model for estimating the #' dose rate of carbonate-rich samples. Ancient TL 32, 24-32. \url{http://ancienttl.org/ATL_32-2_2014/ATL_32-2_Mauz_p24-32.pdf} #' #' Nathan, R.P., Mauz, B., 2008. On the dose-rate estimate of carbonate-rich sediments for trapped charge dating. #' Radiation Measurements 43, 14-25. \doi{10.1016/j.radmeas.2007.12.012} \cr #' #' **Further reading** #' #' Nathan, R.P., 2010. Numerical modelling of environmental dose rate and its application to trapped-charge dating. #' DPhil thesis, St Hugh's College, Oxford. \url{https://ora.ox.ac.uk/objects/ora:6421} #' #' Zimmerman, D.W., 1971. Thermoluminescent dating using fine grains from pottery. #' Archaeometry 13, 29–52.\doi{10.1111/j.1475-4754.1971.tb00028.x} #' #' @keywords dplot manip #' @md #' @export model_DoseRate <- function( data, DR_conv_factors = NULL, length_step = 1L, max_time = 500L, n.MC = 100, method_control = list(), txtProgressBar = TRUE, verbose = TRUE, plot = TRUE, par_local = TRUE, ... ){ # Self-call ----------------------------------------------------------------------------------- ##we keep it as simple as possible, only a data.frame is allowed, all subsequent tests ##are handed over to the code below if(class(data) == "data.frame" && nrow(data) > 1) { ##split input in a list data_list <- split(data, f = 1:nrow(data)) ##get provided arguments ##by using this option we do not have to double check in future whether we missed arguments args <- as.list(match.call()) ##remove first (the function name) and 'data' args[[1]] <- NULL args$data <- NULL ##run function results_list <- lapply(data_list, function(x){ temp <- try(do.call(model_DoseRate, c(list(data = x),args))) if(class(temp) == "try-error"){ try(stop(paste0("[model_DoseRate()] Calculation for sample ", x[[1]], " failed. NULL returned!"), call. = FALSE)) return(NULL) }else{ return(temp) } }) ##remove NULL elements from failed attempts results_list <- results_list[!sapply(results_list, is.null)] ##combine into one single data.frame results <- do.call(rbind, results_list) ##return return(results) } # Integrity tests ----------------------------------------------------------------------------- ##NOTE: The integrity tests are done mainly here and not in the function '.calc_DoseRate' to ##avoid additional overhead ##checks for data if (class(data) != "data.frame") stop("[model_DoseRate()] 'data' is not a 'data.frame'", call. = FALSE) if (nrow(data) == 0) stop("[model_DoseRate()] 'data' is empty!", call. = FALSE) ##remove NA values if (any(is.na(data))) { data <- na.exclude(data) warning("[model_DoseRate()] 'data' contained NA values; removed.", call. = FALSE) ##re-check; maybe it is empty if (nrow(data) == 0) stop("[model_DoseRate()] 'data' is empty!", call. = FALSE) } ##Now check against the example data Example_Data <- NULL data("Example_Data", envir = environment()) ##check columns if (ncol(Example_Data) != ncol(data) && !all(colnames(Example_Data) == colnames(data))) { stop( "[model_DoseRate()] The column names of your input data.frame do not match the requirements. Please check the example dataset via 'data(head(Example_Data))' to see how it should look like!", call. = FALSE ) } ##remove example data rm(Example_Data) ##check n.MC if(is.null(n.MC) || n.MC[1] <= 1){ n.MC <- 1 txtProgressBar <- FALSE } # Rewrite variables names to match the MATLAB code -------------------------------------------- ERROR <- n.MC[1] STEP1 <- length_step[1] # Prepare data -------------------------------------------------------------------------------- ##load reference data here; we do not provide the option to the user to add it here Reference_Data <- NULL data("Reference_Data", envir = environment()) ref <- Reference_Data rm(Reference_Data) #select dose rate conversion factors and check allowed values if(!is.null(DR_conv_factors) && !any(DR_conv_factors %in% ref$DR_conv_factors$REFERENCE)){ temp_allowed <- paste(ref$DR_conv_factors$REFERENCE, collapse = ", ") stop(paste0( "[model_DoseRate()] '", DR_conv_factors, "' does not correspond to an available dose rate conversion dataset. Allowed are: ", temp_allowed), call. = FALSE) } ##set what is set (but not with the same name here) set_DR_conv_factors <- DR_conv_factors ##minimise potential user problems max_time <- max_time[1] ##method control method_control_default <- list( trace = FALSE, lower = 0, upper = max_time ) method_control <- modifyList(x = method_control_default, val = method_control) # Run optimisation ---------------------------------------------------------------------------- ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##AGE ##find minimum DATE <- nlminb( start = STEP1, objective = .calc_DoseRate, control = list( trace = method_control$trace), lower = method_control$lower, upper = method_control$upper, data = data, ref = ref, DR_conv_factors = set_DR_conv_factors, length_step = STEP1, mode_optim = TRUE ) ##calculate values with minimum value DATE <- .calc_DoseRate( x = DATE$par, data = data, ref = ref, DR_conv_factors = set_DR_conv_factors, length_step = STEP1, max_time = max_time ) ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ##UNCERTAINTIES ##ceate needed objects according to MATLAB code DE_ <- numeric(ERROR) DR_ <- matrix(0, nrow = DATE[["LEN"]], ncol = ERROR) DRA_ <- matrix(0, nrow = DATE[["LEN"]], ncol = ERROR) CUMDR_ <- matrix(0, nrow = DATE[["LEN"]], ncol = ERROR) AGE_ <- numeric(ERROR) AGEA_ <- numeric(ERROR) ##create variables we want to use (we do not do this in the loop as in MATLAB) ##TODO: We should evtl. set all values below 0 as NA and remove such lines; this might ##be better than setting it to 0. However, for the moment this is precisely what Carb did before DE <- data[["DE"]] + rnorm(n.MC) * data[["DE_X"]] DE[DE < 0] <- 0 COSMIC <- data[["COSMIC"]] + rnorm(n.MC) * data[["COSMIC_X"]] COSMIC[COSMIC < 0] <- 0 INTERNAL <- data[["INTERNAL"]] + rnorm(n.MC) * data[["INTERNAL_X"]] INTERNAL[INTERNAL < 0] <- 0 ONSET <- round(data[["ONSET"]] + rnorm(n.MC) * data[["ONSET_X"]],0) ONSET[ONSET < 0] <- 0 ONSET[ONSET > max_time] <- max_time FINISH <- round(data[["FINISH"]] + rnorm(n.MC) * data[["FINISH_X"]],0) FINISH[FINISH < 0] <- 0 FINISH[FINISH > ONSET] <- ONSET[FINISH > ONSET] DIAM <- data[["DIAM"]] + rnorm(n.MC) * data[["DIAM_X"]] DIAM[DIAM < 0] <- 0 CC <- data[["CC"]] + rnorm(n.MC) * data[["CC_X"]] CC[CC < 1e-03] <- 1e-03 WCF <- data[["WCF"]] + rnorm(n.MC) * data[["WCF_X"]] WCF[WCF < 1e-03] <- 1e-03 WCI <- data[["WCI"]] + rnorm(n.MC) * data[["WCI_X"]] WCI[WCI < 1e-03] <- 1e-03 K <- data[["K"]] + rnorm(n.MC) * data[["K_X"]] K[K < 0] <- 0 U <- data[["U"]] + rnorm(n.MC) * data[["U_X"]] U[U < 0] <- 0 T <- data[["T"]] + rnorm(n.MC) * data[["T_X"]] T[T < 0] <- 0 ##now combine everything in a data.frame, not efficient but ##we want to stick as close ##as possible with the MATLAB code (the order does not matter) data_MC <- cbind(K, T, U, U238 = rep(data[["U238"]],n.MC), U234_U238 = rep(data[["U234_U238"]],n.MC), WCI, WCF, CC, DIAM, COSMIC, INTERNAL, ONSET, FINISH, DE ) rm(K,T,U,WCI,WCF, CC, DIAM, COSMIC, INTERNAL, ONSET, FINISH, DE) ##set txtprogressbar if(verbose && txtProgressBar) pb <- txtProgressBar(min = 1, max = n.MC, style = 3) ##start loop for(i in 1:n.MC){ DATE_MC <- suppressWarnings(nlminb( start = STEP1, objective = .calc_DoseRate, control = list( trace = FALSE), lower = method_control$lower, upper = method_control$upper, data = data_MC[i,], ref = ref, DR_conv_factors = set_DR_conv_factors, length_step = STEP1, mode_optim = TRUE )) ##calculate values with minium value DATE_MC <- .calc_DoseRate( x = DATE_MC$par, data = data_MC[i,], ref = ref, DR_conv_factors = set_DR_conv_factors, length_step = STEP1, max_time = max_time ) ##fill variables DE_[i] <- data_MC[i,"DE"] DR_[,i] <- DATE_MC$DR DRA_[,i] <- DATE_MC$DRA CUMDR_[,i] <- DATE_MC$CUMDR AGE_[i] <- DATE_MC$AGE AGEA_[i] <- DATE_MC$AGEA ##update progressbar if(verbose && txtProgressBar) setTxtProgressBar(pb,i) } ##close pb if(verbose && txtProgressBar) close(pb) # Extract final values ------------------------------------------------------------------------ ##extract all values we want to return in the terimal and in the results data.frame data_results <- round(data.frame( AGE_CONV = DATE$AGEA, AGE_CONV_X = sd(AGEA_), AGE = DATE$AGE, AGE_X = sd(AGE_), DR_CONV = DATE$DRA[1], DR_CONV_X = sd(DRA_), DR_ONSET = rowMeans(DR_)[nrow(DR_)], DR_ONSET_X = sd(DR_[nrow(DR_),1:n.MC]), DR_FINAL = rowMeans(DR_)[1], DR_FINAL_X = sd(DR_[1,1:n.MC]), n.MC = as.integer(n.MC[1]) ),3) # Terminal output ----------------------------------------------------------------------------- if(verbose){ cat("\n[model_DoseRate()]\n\n") cat(" Sample ID:\t\t", as.character(data[["SAMP_NAME"]]), "\n") cat(" Equivalent dose:\t", round(data[["DE"]],2), " \u00b1 ", round(data[["DE_X"]],2), "Gy\n") cat(" Diameter:\t\t", data[["DIAM"]], "\u00b5m \n") cat(" MC runs error estim.:\t", n.MC," \n") cat(" ------------------------------------------------ \n") cat(" Age (conv.):\t\t",data_results[["AGE_CONV"]], " \u00b1 ", data_results[["AGE_CONV_X"]], " ka\n") cat(" Age (new):\t\t", data_results[["AGE"]], " \u00b1 ", data_results[["AGE_X"]], " ka\n\n") cat(" Dose rate (conv.):\t",data_results[["DR_CONV"]], " \u00b1 ", data_results[["DR_CONV_X"]], " Gy/ka\n") cat(" Dose rate (onset):\t",data_results[["DR_ONSET"]], " \u00b1 ", data_results[["DR_ONSET_X"]], " Gy/ka\n") cat(" Dose rate (final):\t", data_results[["DR_FINAL"]], " \u00b1 ", data_results[["DR_FINAL_X"]], " Gy/ka\n") cat(" ------------------------------------------------ \n") } # Plotting ------------------------------------------------------------------------------------ if(plot){ ##set plot settings plot_settings <- modifyList(x = list( mfrow = c(2,1), xlim = c(0, max(c(DATE[["AGE"]], DATE[["AGEA"]])) * 1.1), xlab = "Time [ka]" ), val = list(...)) ##par settings; including restoring them if(par_local){ par.default <- list(mfrow = par()$mfrow) on.exit(do.call(par, args = par.default)) par(mfrow = plot_settings$mfrow) } ##calculate some variables needed later DR_rowMeans <- rowMeans(DR_) DR_rowSds <- matrixStats::rowSds(DR_) CUMDR_rowMeans <- rowMeans(CUMDR_) CUMDR_rowSds <- matrixStats::rowSds(CUMDR_) ## +++++++++++++++++ ##(A) dose rate plot plot( NA, NA, xlim = plot_settings$xlim, ylim = if(n.MC > 2){ range(c(DR_rowMeans - DR_rowSds, DR_rowMeans + DR_rowSds)) }else{ range(DR_rowMeans) }, xlab = plot_settings$xlab, ylab = "Dose rate [Gy/ka]", main = data[["SAMP_NAME"]] ) ##abline abline(v = 0, lty = 2) text(x = 0, mean(DATE[["DR"]]), labels = "(sampling)", srt = 90, cex = .5, pos = 2) axis( side = 3, at = c(data[["ONSET"]], data[["FINISH"]], DATE[["AGE"]]), tick = FALSE, labels = c(expression(t[m[0]]),expression(t[m[1]]), expression(t[0])), padj = 1.2) ##error polygon polygon( x = c(0:max_time, max_time:0), y = c( DR_rowMeans + DR_rowSds, rev(DR_rowMeans - DR_rowSds)), col = rgb(0, 0, 0, .1), border = NA ) ##add center line lines(x = 0:max_time, y = DATE[["DR"]], lwd = 1) ##set mean line (give a good indication whether the n.MC runs had been enough) lines(x = 0:max_time, y = rowMeans(DR_), lwd = 1, lty = 2, col = "blue") ## +++++++++++++++++ ##(B) accummulated dose and age plot( NA, NA, xlim = plot_settings$xlim, ylim = c(0, data[["DE"]] * 1.2), xlab = plot_settings$xlab, ylab = "Absorbed dose [Gy]", main = data[["SAMP_NAME"]], sub = paste0("(n.MC = ",n.MC,")") ) ##add error polygon polygon( x = c(0:max_time, max_time:0), y = c( CUMDR_rowMeans + CUMDR_rowSds, rev(CUMDR_rowMeans - CUMDR_rowSds)), col = rgb(0, 0, 0, .1), border = NA ) ##lines showing the De distribution used for MC runs density_De_y <- seq(0, data[["DE"]] * 1.2, length.out = 100) density_De_x <- (1 / sqrt(2 * pi * data[["DE_X"]]^2)) * exp(-(density_De_y - data[["DE"]])^2 / 2 * data[["DE_X"]]^2) ##this looks weird, otherwise the plot is not really right and we have overplotting ##issues density_De_x <- (density_De_x * -par()$usr[1])/ max(density_De_x) + par()$usr[1] density_De_x[which.min(density_De_x)] <- min(density_De_x) density_De_x[density_De_x <= par()$usr[1]] <- par()$usr[1] - 0.2 lines(x = density_De_x, density_De_y, col = "red") ##centre lines horizontal (De) lines( x = c(0, DATE[["AGE"]]), y = rep(data[["DE"]], 2), col = "red", lty = 2 ) ##center lines vertical (age) lines(x = rep(DATE[["AGE"]], 2), y = c(0, data[["DE"]]), col = "red", lty = 2) ##add density (two times, 1st density lines, then colour) if(n.MC > 1){ temp_density <- density(AGE_) polygon( x = c(temp_density$x, rev(temp_density$x)), y = c((temp_density$y * data[["DE"]]) / max(temp_density$y), rep(0,length(temp_density$x))), lty = 1, density = 10, col = "grey" ) polygon( x = c(temp_density$x, rev(temp_density$x)), y = c((temp_density$y * data[["DE"]]) / max(temp_density$y), rep(0,length(temp_density$x))), lty = 0, col = rgb(1,0,0,.2) ) } ##add lines of absorbed dose lines(x = 0:max_time, y = DATE[["CUMDR"]]) ##add central point points(x = DATE[["AGE"]], y = data[["DE"]], cex = 1.4, pch = 21, col = "red", bg = "grey") ##add mtext mtext(side = 3, text = paste0("Age: ", round(DATE$AGE,2), " \u00b1 ", round(sd(AGE_),2), " ka")) }#end plot # Return value -------------------------------------------------------------------------------- ##the return value is the input data.frame + added lines results <- cbind( data, data_results, stringsAsFactors = FALSE ) ##add attributes to data.frame attr(results, which = "package") <- "RCarb" ##return return(results) } RCarb/inst/0000755000175000017500000000000014203705624012355 5ustar nileshnileshRCarb/inst/CITATION0000644000175000017500000000072413730112467013516 0ustar nileshnileshcitHeader("To cite the R package 'RCarb' please apply the entries below where applicable:") citation(auto = meta) bibentry(bibtype = "Article", title = "'RCarb': Dose Rate Modelling of Carbonate-Rich Samples - an Implementation of Carb in R -", author = "Sebastian Kreutzer, Barbara Mauz, Loïc Martin, Norbert Mercier", year = "2019", journal = "Ancient TL", volume = "37", number = "2", pages = "1-8") RCarb/inst/WORDLIST0000644000175000017500000000075413730111341013544 0ustar nileshnileshac Adamiec ancienttl ANR ASTAR Atiken Atomkernenergie Carb carbonatisation CNRS codecov conv Coursey cran CREDit CRP dissatisfactory doi Dokumentation DoseRate ENSDF ESTAR fuer github GitHub’ gov Guérin Hoffmann Hubbell InputTemplate io Ioannides IRAMAT LabEx LABX LaScArBxSK Libre Liritzis lum LV md Mejdahl nd nist ora org Papachristodoulou PSTAR radmeas RLumCarlo RLumModel RLumShiny Skłodowska Stamoulis Szybisz Thermoluminescent TL uk UMR Université xaamdi ZAED Zentralstelle ZuckerRCarb/inst/doc/0000755000175000017500000000000014203705624013122 5ustar nileshnileshRCarb/inst/doc/GetStarted.html.asis0000644000175000017500000000023213355136342017013 0ustar nileshnilesh%\VignetteIndexEntry{Get started with RCarb} %\VignetteEngine{R.rsp::asis} %\VignetteKeyword{HTML} %\VignetteKeyword{vignette} %\VignetteKeyword{package} RCarb/inst/doc/GetStarted.html0000644000175000017500000051312714203705624016067 0ustar nileshnilesh Get started with RCarb

Get started with RCarb

Sebastian Kreutzer1,2 & Barbara Mauz3

Last modified: 2022-02-18 (‘RCarb’ version: 0.1.5)

1Geography & Earth Science, Aberystwyth University (United Kingdom)
2Archéosciences Bordeaux, UMR 6034, CNRS-Université Bordeaux Montaigne (France)
3Department of Geography and Geology, University of Salzburg, Salzburg (Austria)”

Scope

Getting started with a new R package can be a very tedious business (if not to say annoying). This document was written with the intention to make your first steps as painless as possible.

Quick start with the example dataset

If you have no idea what a function does and how it works, it is always a good idea to have a closer look into the example sections of the package functions. The package 'RCarb' has one central function named model_DoseRate(). The example given in the example section in the manual will be used in the following to illustrate the central package functionality in three steps.

Load ‘RCarb’

library(RCarb)

Load example data

##load example data
data("Example_Data", envir = environment())

To get a first impression on how the example dataset looks like, you call the function head() to print the first five rows of a data.frame on the terminal.

head(Example_Data)
##   SAMP_NAME     K   K_X    T  T_X    U  U_X U238 U238_X U234_U238 U234_U238_X
## 1     BN107 0.080 0.010 1.64 0.08 1.90 0.08    0      0         0           0
## 2     BN102 0.170 0.009 2.59 0.03 3.02 0.07    0      0         0           0
## 3     BN106 0.560 0.030 1.80 0.11 0.83 0.03    0      0         0           0
## 4      LV61 0.131 0.005 0.85 0.03 0.86 0.11    0      0         0           0
## 5      LV99 0.047 0.003 0.59 0.03 1.94 0.11    0      0         0           0
## 6      D101 0.105 0.004 0.65 0.02 1.25 0.08    0      0         0           0
##   WCI WCI_X WCF WCF_X CC CC_X DIAM DIAM_X COSMIC COSMIC_X INTERNAL INTERNAL_X
## 1  20     7   7     7 62    1  180     10  0.180   0.0100        0          0
## 2  20    10  10    10 68    1  180     22  0.180   0.0100        0          0
## 3  20     6   6     6 49    1  145     15  0.180   0.0100        0          0
## 4  12     5   2     2 17    1  210     30  0.069   0.0035        0          0
## 5   8     3   5     5 61    3  210     30  0.182   0.0090        0          0
## 6   8     3   2     2 59    2  210     20  0.180   0.0100        0          0
##   ONSET ONSET_X FINISH FINISH_X  DE DE_X
## 1   100      10     40       10  98    9
## 2   100      10     40       10 130   10
## 3   100      10     40       10 120   10
## 4   120      10     40       10  52    5
## 5    60      10     40       10  50    4
## 6   180      10    130       10  81    5

Unfortunately, the naming of the table columns is not straightforward to understand. The good news is that each column carries additional information that can be seen in the R terminal by typing, e.g., for the column ‘K’ (which is the 2nd column):

attributes(Example_Data$K)
## $UNIT
## [1] "%"
## 
## $DESCRIPTION
## [1] "K concentration"

It reveals that the numbers in the column correspond to the potassium concentration and are given in ‘%’. Similar all other columns can be inspected.

And here the full overview

COLUM UNIT DESCRIPTION
SAMP_NAME NA Sample name, unique identifier
K % K concentration
K_X % K concentration standard error
T ppm Th concentration
T_X ppm Th concentration standard error
U ppm U concentration
U_X ppm U concentration standard error
U238 ppm U-238 concentration
U238_X ppm U-238 concentration standard error
U234_U238 NA U-234/U-238 activity ratio
U234_U238_X NA U-234/U-238 activity ratio standard error
WCI % dry wt. Initial water content
WCI_X % dry wt. Initial water content standard error
WCF % dry wt. Final water content
WCF_X % dry wt. Final water content standard error
CC % dry wt. Carbonate content
CC_X % dry wt. Carbonate content standard error
DIAM m x 10^-6 Grain diameter
DIAM_X m x 10^-6 Grain diameter standard error
COSMIC Gy/ka Cosmic dose rate
COSMIC_X Gy/ka Cosmic dose rate standard error
INTERNAL Gy/ka Internal dose rate
INTERNAL_X Gy/ka Internal dose standard error
ONSET ka Carbonate onset
ONSET_X ka Carbonate onset standard error
FINISH ka Carbonate completion
FINISH_X ka Carbonate completion standard error
DE Gy Equivalent dose
DE_X Gy Equivalent dose standard error

Run dose rate modelling

Now we want to start the modelling using the data given for the first sample only.

##extract only the first row 
data <- Example_Data[1,]

##run model 
results <- model_DoseRate(
  data = data,
  DR_conv_factors = "Carb2007",
  n.MC = 10, 
  txtProgressBar = FALSE)
## 
## [model_DoseRate()]
## 
##  Sample ID:       BN107 
##  Equivalent dose:     98  ±  9 Gy
##  Diameter:        180 µm 
##  MC runs error estim.:    10  
##  ------------------------------------------------ 
##  Age (conv.):         133.451  ±  9.853  ka
##  Age (new):       117.443  ±  7.584  ka
## 
##  Dose rate (conv.):   0.734  ±  0.036  Gy/ka
##  Dose rate (onset):   0.975  ±  0.046  Gy/ka
##  Dose rate (final):   0.739  ±  0.022  Gy/ka
##  ------------------------------------------------

The function returns a terminal output along with two plots, which are mostly similar to the original graphical output provided by the ‘MATLAB’ program ‘Carb’.

In the example above the function model_DoseRate() was called with three additional arguments, DR_conv_factors = "Carb2007", n.MC = 10, txtProgressBar = FALSE. The first argument selects the dose rate conversion factors used by ‘RCarb’. The second argument limits the number of Monte Carlo runs for the error estimation to 10 and the second argument prevents the plotting of the progress bar, indicating the progression of the calculation. Both arguments were solely set to reduce calculation time and output in this vignette.

Obviously, you do not want to run each row in the input table separately to model all dose rates, so to run all the modelling for all samples in the example dataset you can call the model without subsetting the dataset first. Be careful, the calculation may take some time.

results <- model_DoseRate(
  data = Example_Data)

A note on the used dose rate conversion factors: For historical reasons ‘Carb’ has its own set of dose rate conversion factors, which differ slightly from values in the literature (e.g., Adamiec & Atiken, 1998) and are used in 'RCarb' as default values. However, with 'RCarb' >= 0.1.3 you can select other dose rate conversion factors. Please type ?RCarb::Reference_Data in your R terminal for further details.

Using your own dataset

Running only the example dataset is somewhat dissatisfactory, and the usual case will be that you provide your own dataset as input. While you can enter all data directly using R, the package offers another way, using external spreadsheet software such as ‘Libre Office’ (or, of course, MS Excel). The procedure is sketched in the following.

Create template table

The function write_InputTemplate() was written to create a template table (a CSV-file) that can be subsequently opened and filled. Using the function ensures that your input data have the correct structure, e.g., the correct number for columns and column names.

write_InputTemplate(file = "files/RCarb_Input.csv")

The path given with the argument file can be modified as needed.

Enter own data & back import into R

Own data are added using an external spreadsheet program and then save again as CSV-file.

For re-importing, the data standard R functionality can be used.

data <- read.csv(file = "files/RCarb_Input.csv")

Model the dose rate

The final modelling does not differ from the call already show above (here without a plot output):

##run model 
results <- model_DoseRate(
  data = data,
  n.MC = 10, 
  txtProgressBar = FALSE, 
  plot = FALSE)
## 
## [model_DoseRate()]
## 
##  Sample ID:       EXAMPLE 
##  Equivalent dose:     98  ±  9 Gy
##  Diameter:        180 µm 
##  MC runs error estim.:    10  
##  ------------------------------------------------ 
##  Age (conv.):         133.451  ±  16.814  ka
##  Age (new):       117.443  ±  10.792  ka
## 
##  Dose rate (conv.):   0.734  ±  0.053  Gy/ka
##  Dose rate (onset):   0.998  ±  0.039  Gy/ka
##  Dose rate (final):   0.754  ±  0.043  Gy/ka
##  ------------------------------------------------

I don’t like R

Well, then you are wrong here. However, if you are just tired of using the R terminal and you want to have a graphical user interface to interact with ‘RCarb’? Surprise: We also spent countless hours to develop a shiny application called ‘RCarb app’, and we ship it as part of the R package ‘RLumShiny’.

References

Adamiec, G., Aitken, M.J., 1998. Dose-rate conversion factors: update. Ancient TL 16, 37–50. http://ancienttl.org/ATL_16-2_1998/ATL_16-2_Adamiec_p37-50.pdf

RCarb/data/0000755000175000017500000000000013730102122012275 5ustar nileshnileshRCarb/data/datalist0000644000175000017500000000011114203705614014031 0ustar nileshnileshExample_Data: Example_Data Reference_Data: Reference_Data Reference_Data RCarb/data/Example_Data.rda0000644000175000017500000000422013730102040015306 0ustar nileshnilesh7zXZi"6!X&nT])TW"nRʟOqcWK>=klt˙[bvܦ(]Y %̧( 5T*{"Z)~h|Ӽ%q^fHeMHL'nz,NzS瞫.:Kа O܍Ĺl>^?a\+IJ` @z"deB=3:V:)sx@j5@er'r62<.ACXvSIiJ7FqMpR5nr'o{,OGrTeIבp:oj |_R+׈kU`PKW)ɰ) G:ÃJ^\!ILNPSbO& d i8/7bshP`tB{”78E^.jþ~ړt #&D:lsvj#X £ "֏?2QHzUmRdx"BDD(\.1r[Hn)TUd7Rř "דI8=,{0ƛoʌ:Ai[*'TIJfwozbf;s.43te9Pر63 q٨ɬP"͌lrZY;|/MNSn*`qerrt-}>?jzi^-!0kB ![ʍmf[~SsUC7]gۜ !9׊󧁋$u)ݫon6uO_m ӳ9? ҰGJTFy?yH0)1< _Xpmgd$W#`UgΛtq]4T`V 7v@?Vx@`0W|ճ;feQlq&qdJa yon1ty^g]7Ԍ i/0ك+fFb>Y5Rb:z!0ai5LAfa.&"0_9U~%)OuvJ2^gfoP ;$usaȝV% Dտb#m=3HwTKPk'WhN}{Ul祿njU(˂4d";~4(Ҙ~(f<![X_TrP/J.-]!Z=W{gZ.WVK=jwiBߓ>U2s믾2ʩd5ѐAt4{ua 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+^4 ,m)dWg 7s/JFG&e_Xhgt:8ob5fc~_c۾{FO[kNs?hOݘ^d6BpOw9Ku} 8֨<BiN9s5DoΦXCb|19GۑuD! &\}C8PٷN䶜4uu}=x>ss5LƋu噬֬ $̽BdaE;&ZNʀ/ Z*jzȐ8u(ء'VV̋Wb>r]?lI?wEKf 2'M=?,8Xt^U[.7mfjBc1]=/6-C3lA d) Bz /[ 4KuH$4HƉWbNNP(bgwL75g.(bt\T$_V;/}#wp[ @en![39iījSQ2iBu4g M|~2?;-!V8,L$sgnOU@N@tژ!ٯ1nKkbA3,+o`4,1\? {eMƾ()m/"X:6L%+yOj7=PaYˑۿ_4 Zq.4JBt*u``C׌Hzܫ&֤|twtSe[]>>0 YZRCarb/NAMESPACE0000644000175000017500000000106314203705615012617 0ustar nileshnilesh# Generated by roxygen2: do not edit by hand export(model_DoseRate) export(write_InputTemplate) import(utils) importFrom(grDevices,rgb) importFrom(graphics,abline) importFrom(graphics,axis) importFrom(graphics,lines) importFrom(graphics,mtext) importFrom(graphics,par) importFrom(graphics,plot) importFrom(graphics,plot.default) importFrom(graphics,points) importFrom(graphics,polygon) importFrom(graphics,text) importFrom(stats,approx) importFrom(stats,density) importFrom(stats,na.exclude) importFrom(stats,nlminb) importFrom(stats,rnorm) importFrom(stats,sd)