rstanosl
is an R package for fitting Optical Stimulated Luminescence (OSL) models using Stan.
You can install the development version of rstanosl
from GitHub with:
devtools::install_github("zaandahl/rstanosl")
If you want you can also install the package with a vignette. You need to install bayesplot
prior to building the vignette. This will take a few minutes to create:
devtools::install_github("zaandahl/rstanosl", build_vignettes = TRUE)
Load the package:
library(rstanosl)
Load the example data:
library(rstanosl)
Fit a ALMM model to a single depth layer of the data:
osl_data_46 <- osl_data %>% filter(Depth == 46)
almm_fit <- almm(osl_data_46, logged = T, sigma = NULL, refresh = 0)
- Getting Started with rstanosl Vignette: A step-by-step guide to using the rstanosl package with example data.
- Stan documentation: Learn more about Stan, a probabilistic programming language for statistical modeling.
You can build this package from a Docker container that runs RStudio Server with the following commands:
docker compose build
docker compose up
Then, open a web browser and navigate to http://localhost:8787. Log in with username rstudio
and password rstudio
. Then, run the following commands in the RStudio console:
setwd("./package")
source("inst/logo/logo.R")
knitr::knit("README.Rmd", "README.md")
devtools::document()
devtools::build()
devtools::install(build_vignettes = TRUE)
After you have finished building the package you can load in RStudio and save it as a tarball:
library(rstanosl)
save.image()
Then, you can exit the Docker container by pressing Ctrl+C
in the terminal window where you ran docker compose up
. Finally, you can remove the Docker container with the following command:
docker compose down
BSD-3-Clause License (see LICENSE file)