Skip to content

Commit

Permalink
pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheMax committed Jun 7, 2024
1 parent b43fe13 commit 592d773
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 67 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/deploy-pkgdown.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ inst/doc
.Rproj.user
tests/testthat/Rplots.pdf
docs
.Rhistory
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ Collate:
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
BugReports: https://github.com/optad/adoptr/issues
URL: https://github.com/optad/adoptr
URL: https://github.com/optad/adoptr, https://optad.github.io/adoptr/
11 changes: 3 additions & 8 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
destination: docs

url: https://optad.github.io/adoptr

url: https://optad.github.io/adoptr/
navbar:
left:
- icon: fa-home fa-lg
Expand All @@ -27,9 +25,6 @@ navbar:
right:
- icon: fa-github fa-lg
href: https://github.com/optad/adoptr

template:
params:
docsearch:
api_key: f5b8253ef131d8de31a2e0e075678ba8
index_name: adoptr
bootstrap: 5

Binary file added pkgdown/assets/structure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-120x120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-152x152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-180x180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-60x60.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon-76x76.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 8 additions & 10 deletions vignettes/adoptr_jss.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ $$
of a two-stage design for given $n_1,c_1^f, c_1^e$ with respect to $n_2(\cdot)$
for given power and type one error rate constraints.
The function $c_2(\cdot)$, however, was not optimized.
Instead, @JT2015 used a combination test approach to derive $c_2$ given
$n_2(\cdot)$ and $n_1$ (cf. Equation \@ref(eq:inverse-normal)).
Instead, @JT2015 used the inverse-normal combination test approach to derive $c_2$
given $n_2(\cdot)$ and $n_1$.
In @variational, the authors demonstrated that this restriction is not
necessary and that the variational problem of deriving both functions $n_2(\cdot)$
and $c_2(\cdot)$ given $n_1,c_1^f, c_1^e$ to minimize expected sample size can be
Expand Down Expand Up @@ -461,7 +461,7 @@ The package **adoptr** is based on **R**'s S4 class system.
This allows to use multiple dispatch on the classes of multiple arguments
to a method.
In this section, the central components of **adoptr** are described briefly.
Figure \@ref(fig:class-diagram) gives a structural overview of the main
The following figure gives a structural overview of the main
classes in **adoptr**.

```{r class-diagram, out.width='100%', echo=FALSE, fig.cap='Overview of the most important classes and methods (in italic) in the R-package adoptr. A subclassing relationship is indicated by a connecting line to the corresponding super class above it. The most important methods for each class are listed under the respective class name in italic font.'}
Expand Down Expand Up @@ -639,10 +639,9 @@ $x_1$ on the $x$-axis and the respective function on the $y$-axis.
```{r, standard-case, fig.height=2.25*1.25, fig.width=6*1.25, out.width='100%', fig.cap="Optimal sample size, critical value, and conditional power plotted against the interim test statistic (built-in plot method)."}
plot(opt1$design, `Conditional power` = cp)
```
Note the slightly bent shape of the $c_2(\cdot)$ function
(cf. Figure \@ref(fig:standard-case), second plot).
Note the slightly bent shape of the $c_2(\cdot)$ function.
For two-stage designs based on the inverse-normal combination function, $c_2(\cdot)$
would be linear by definition (cf. Equation \@ref(eq:inverse-normal)).
would be linear by definition.
Since the optimal shape of $c_2(\cdot)$ is not linear (but almost), inverse-normal
combination methods are slightly less efficient (cf. @variational for a more
detailed discussion of this issue).
Expand Down Expand Up @@ -755,7 +754,7 @@ evaluate(epower, opt3$design)
```

The three optimal designs which have been computed so far are depicted
in a joint plot (cf. Figure \@ref(fig:comparison)).
in a joint plot.
The design using the continuous prior requires higher sample sizes
due to the higher uncertainty about $\theta$.
The utility maximization approach results in similar shapes of $n(\cdot)$ and
Expand Down Expand Up @@ -877,8 +876,7 @@ opt4 <- minimize(ess, subject_to(toer <= 0.025, power >= 0.9, cp >= 0.8),
Comparing the optimal design that has been computed here with the same constraints
but without a conditional power constraint (cf. beginning of this chapter),
the optimal design with the additional constraint requires larger sample sizes in
regions where the conditional power would usually be below the given threshold
(cf. Figure \@ref(fig:cp-constraint), first and third plot).
regions where the conditional power would usually be below the given threshold.
Overall, the additional constraint reduces the feasible solution space and
consequently increases the expected sample size
(`r if (buildvignette) evaluate(ess, opt4$design) %>% round(1)` with conditional power constraint
Expand Down Expand Up @@ -988,7 +986,7 @@ Note that it is also possible to 'un-fix' parameters again using the
opt5 <- minimize(ess, subject_to(toer <= 0.025, power >= 0.9),
initial_design)
```
Figure \@ref(fig:tunable) visually compares the original design with the new,
The following figure visually compares the original design with the new,
more restricted design.
The designs are qualitatively similar, but fixing $n_1$ and $c_1^f$ does
come at the price of slightly increased expected sample size
Expand Down
Binary file modified vignettes/structure.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 592d773

Please sign in to comment.