Skip to content

Commit 91962bb

Browse files
committed
DOcument apps
Signed-off-by: Peter Solymos <psolymos@gmail.com>
1 parent 0983870 commit 91962bb

5 files changed

Lines changed: 65 additions & 54 deletions

File tree

README.Rmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,20 @@ run_app("distfunH")
119119
run_app("distfunHER")
120120
```
121121

122-
Compare simulation settings for single landscape:
122+
Compare simulation settings for a single landscape:
123123

124124
```{r eval=FALSE}
125125
run_app("bsimsH")
126126
run_app("bsimsHER")
127127
```
128128

129+
The [Shinylive](https://shinylive.io/r/examples/) versions of the apps can be found here:
130+
131+
- [`distfunH`](https://peter.solymos.org/bSims/apps/distfunH/)
132+
- [`distfunHER`](https://peter.solymos.org/bSims/apps/distfunHER/)
133+
- [`bsimsH`](https://peter.solymos.org/bSims/apps/bsimsH/)
134+
- [`bsimsHER`](https://peter.solymos.org/bSims/apps/bsimsHER/)
135+
129136
### Replicating simulations
130137

131138
Interactive sessions can be used to explore different settings.

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ get_table(x)
103103
#> 50-100m 3 0 1
104104
#> 100-150m 4 1 0
105105
#> 150+m 8 3 0
106-
```
107-
108-
``` r
109106

110107
head(get_events(a))
111108
#> x y t v a i
@@ -115,9 +112,6 @@ head(get_events(a))
115112
#> 4 -2.1041934 -1.6092706 0.03936096 1 295 19
116113
#> 5 -4.9531338 -0.4093427 0.04890537 1 217 11
117114
#> 6 -3.3127196 -0.2145475 0.08899310 1 215 15
118-
```
119-
120-
``` r
121115

122116
head(get_detections(o))
123117
#> x y t v a d f i j
@@ -141,13 +135,21 @@ run_app("distfunH")
141135
run_app("distfunHER")
142136
```
143137

144-
Compare simulation settings for single landscape:
138+
Compare simulation settings for a single landscape:
145139

146140
``` r
147141
run_app("bsimsH")
148142
run_app("bsimsHER")
149143
```
150144

145+
The [Shinylive](https://shinylive.io/r/examples/) versions of the apps
146+
can be found here:
147+
148+
- [`distfunH`](https://peter.solymos.org/bSims/apps/distfunH/)
149+
- [`distfunHER`](https://peter.solymos.org/bSims/apps/distfunHER/)
150+
- [`bsimsH`](https://peter.solymos.org/bSims/apps/bsimsH/)
151+
- [`bsimsHER`](https://peter.solymos.org/bSims/apps/bsimsHER/)
152+
151153
### Replicating simulations
152154

153155
Interactive sessions can be used to explore different settings. Settings
@@ -182,32 +184,23 @@ nc <- 2 # number of cores
182184
## sequential
183185
system.time(bb <- b$replicate(B, cl=NULL))
184186
#> user system elapsed
185-
#> 0.232 0.001 0.233
186-
```
187-
188-
``` r
187+
#> 0.235 0.002 0.237
189188

190189
## parallel clusters
191190
cl <- makeCluster(nc)
192191
## note: loading the package is optional
193192
system.time(clusterEvalQ(cl, library(bSims)))
194193
#> user system elapsed
195-
#> 0.000 0.000 0.439
196-
```
197-
198-
``` r
194+
#> 0.000 0.000 0.444
199195
system.time(bb <- b$replicate(B, cl=cl))
200196
#> user system elapsed
201-
#> 0.004 0.001 0.194
202-
```
203-
204-
``` r
197+
#> 0.004 0.001 0.189
205198
stopCluster(cl)
206199

207200
## parallel forking
208201
if (.Platform$OS.type != "windows") {
209202
system.time(bb <- b$replicate(B, cl=nc))
210203
}
211204
#> user system elapsed
212-
#> 0.119 0.046 0.182
205+
#> 0.127 0.048 0.177
213206
```

RELEASE.R

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,3 @@ devtools::check()
1616
# install
1717
devtools::install()
1818

19-
# multi-arch checks
20-
library(rhub)
21-
#validate_email("peter@analythium.io")
22-
platforms()
23-
f <- c("debian-gcc-devel",
24-
"debian-gcc-release",
25-
"macos-highsierra-release-cran",
26-
"windows-x86_64-devel",
27-
"windows-x86_64-release",
28-
"windows-x86_64-oldrel")
29-
check(platform=f)
30-
list_package_checks(".")
31-
32-
# build package to submit
33-
devtools::build()
34-
35-
pkgnews <- function() {
36-
x <- readLines("NEWS.md")
37-
x <- x[x != ""]
38-
h <- which(startsWith(x, "#"))
39-
i <- (h[1]+1):(h[2]-1)
40-
paste0(x[i], collapse="\n")
41-
}
42-
cat(sprintf('Dear CRAN Maintainers,
43-
I am submitting the %s version of the bSims R extension package to CRAN.
44-
The package passed R CMD check --as-cran without errors/warnings/notes on the following platforms: %s.
45-
I made the following changes since the last release:
46-
%s
47-
Yours,
48-
Peter Solymos
49-
maintainer', read.dcf("DESCRIPTION", fields="Version")[1],
50-
paste0(f, collapse=", "),
51-
pkgnews()))

inst/WORDLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RStudio
2020
Reparametrized
2121
SDlog
2222
Schmiegelow
23+
Shinylive
2324
Stralberg
2425
VSCode
2526
Voronoi

vignettes/bsims04-apps.Rmd

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "Explore bSims with Shiny apps"
3+
author: "Peter Solymos"
4+
output: rmarkdown::html_vignette
5+
vignette: >
6+
%\VignetteIndexEntry{Simulation workflow in bSims}
7+
%\VignetteEngine{knitr::rmarkdown}
8+
%\VignetteEncoding{UTF-8}
9+
---
10+
11+
```{r setup,include=FALSE}
12+
knitr::opts_chunk$set(
13+
collapse = TRUE,
14+
comment = "#>"
15+
)
16+
par(mar = c(1, 1, 1, 1))
17+
set.seed(429)
18+
suppressPackageStartupMessages(library(bSims))
19+
```
20+
21+
bSims comes with a few [Shiny](https://shiny.posit.co/) apps.
22+
These can be used to interactively explore the effects of different settings.
23+
24+
Compare distance functions:
25+
26+
```{r eval=FALSE}
27+
run_app("distfunH")
28+
run_app("distfunHER")
29+
```
30+
31+
Compare simulation settings for a single landscape:
32+
33+
```{r eval=FALSE}
34+
run_app("bsimsH")
35+
run_app("bsimsHER")
36+
```
37+
38+
The [Shinylive](https://shinylive.io/r/examples/) versions of the apps can be found here:
39+
40+
- [`distfunH`](https://peter.solymos.org/bSims/apps/distfunH/)
41+
- [`distfunHER`](https://peter.solymos.org/bSims/apps/distfunHER/)
42+
- [`bsimsH`](https://peter.solymos.org/bSims/apps/bsimsH/)
43+
- [`bsimsHER`](https://peter.solymos.org/bSims/apps/bsimsHER/)

0 commit comments

Comments
 (0)