-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
93 lines (63 loc) · 2.41 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output:
github_document:
html_preview: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE)
```
<img src="man/figures/logo.png" alt="rstanosl Hex Sticker" width="200" align="right"/>
# rstanosl
`rstanosl` is an R package for fitting Optical Stimulated Luminescence (OSL) models using Stan.
## Installation
You can install the development version of `rstanosl` from GitHub with:
```{r eval=FALSE}
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:
```{r eval=FALSE}
devtools::install_github("zaandahl/rstanosl", build_vignettes = TRUE)
```
## Getting Started
Load the package:
```{r eval=FALSE}
library(rstanosl)
```
Load the example data:
```{r eval=FALSE}
library(rstanosl)
```
Fit a ALMM model to a single depth layer of the data:
```{r eval=FALSE}
osl_data_46 <- osl_data %>% filter(Depth == 46)
almm_fit <- almm(osl_data_46, logged = T, sigma = NULL, refresh = 0)
```
## Further Resources
- [Getting Started with rstanosl Vignette](link-to-vignette): A step-by-step guide to using the rstanosl package with example data.
- [Stan documentation](https://mc-stan.org/users/documentation/): Learn more about Stan, a probabilistic programming language for statistical modeling.
## Building this package with `devtools` README and vignette
You can build this package from a Docker container that runs RStudio Server with the following commands:
```{bash eval=FALSE}
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:
```{r eval=FALSE}
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:
```{r eval=FALSE}
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:
```{bash eval=FALSE}
docker compose down
```
## License
BSD-3-Clause License (see LICENSE file)