Skip to content

Commit d2cf1f0

Browse files
authored
Merge pull request #10 from rpahl/dev
Dev
2 parents 90b57ef + 2851adf commit d2cf1f0

File tree

167 files changed

+3437
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3437
-285
lines changed

.Rbuildignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.git
22
.gitignore
33
TODO
4+
.Rprofile
45
^.*\.Rproj$
56
^\.Rproj\.user$
67
^\.github$
@@ -10,7 +11,6 @@ tags
1011
^docs$
1112
^doc$
1213
^README\.Rmd$
13-
^doc$
1414
^Meta$
1515

1616
^images$

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.Rproj.user
22
.Rhistory
33
.RData
4+
.Rprofile
45
*.Rproj
56

67
vignettes/*.html

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Imports:
1313
tcltk2,
1414
mvtnorm,
1515
container (>= 1.0.0)
16-
Suggests: knitr, tinytest, rmarkdown
16+
Suggests: knitr, tinytest, rmarkdown, ggplot2, gridExtra
1717
VignetteBuilder: knitr
1818
License: GPL-3
19-
URL: https://github.com/rpahl/GroupSeq
19+
URL: https://rpahl.github.io/GroupSeq/
2020
BugReports: https://github.com/rpahl/GroupSeq/issues
2121
NeedsCompilation: no
2222
Author: Roman Pahl [aut, cre]

NAMESPACE

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(seqDesign)
4-
export(seqProb)
53
export(start_gui)
64
import(mvtnorm)
75
import(tcltk)

NEWS.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# GroupSeq 1.4.0
22

33
* Create package site
4+
* Set new GroupSeq logo in GUI
45

56

67
# GroupSeq 1.3.3

R/groupseq.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ update_changed_parameters <- function()
6565

6666

6767
#' @title Start GroupSeq
68-
#' @description Starts the graphical user interface, optionally the legacy
69-
#' version of GroupSeq prior to version 2.
70-
#' @param legacy `logical` if `TRUE`, starts legacy GroupSeq version < 2.
68+
#' @description Starts the graphical user interface.
7169
#' @export
72-
start_gui <- function(legacy = FALSE)
70+
start_gui <- function()
7371
{
72+
legacy = TRUE
7473
init_env(legacy)
74+
7575
if (legacy) {
7676
guiMode()
7777
} else {
@@ -85,7 +85,7 @@ start_gui <- function(legacy = FALSE)
8585
{
8686
.env <<- container::dict()
8787

88-
doStart <- getOption("AutostartGroupSeq", default = FALSE)
88+
doStart <- getOption("AutostartGroupSeq", default = TRUE)
8989
if (interactive() && doStart) {
9090
start_gui()
9191
} else {

R/gui.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ gui <- function(root, tabs = c("Test parameters", "Boundaries"))
2323
# Make sure cleanup takes place also when user closes window via "X" button
2424
tkwm.protocol(root, "WM_DELETE_WINDOW", onQuit)
2525
tkwm.title(root, paste0("[New] - GroupSeq"))
26-
if (.Platform$OS.type == "windows") {
27-
iconfile <- system.file("icons", "gs-logo.ico", package = "GroupSeq")
28-
tkwm.iconbitmap(root, iconfile)
29-
}
26+
27+
logofile <- system.file("img", "logo32.gif", package = "GroupSeq")
28+
tkimage.create("photo", "::image::logoIcon", file = logofile)
29+
tcl("wm", "iconphoto", root, "-default", "::image::logoIcon")
3030

3131
# Menu
3232
menu <- tkmenu(root)

R/sequential.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#' p <- seqProb(c(2, 1), mean=0)
4040
#' seqProb(c(2, 1), mean=0, tau=c(.25, 0.5)) == p # TRUE
4141
#' seqProb(c(2, 1), mean=0, tau=c(.25, 1)) == p # FALSE
42-
#' @export
42+
#' @noRd
4343
seqProb <- function(up,
4444
lo = rep(-Inf, length(up)),
4545
tau = seq_along(up) / length(up),
@@ -148,6 +148,7 @@ seqProb <- function(up,
148148
#' provide the total expected sample size.
149149
#'
150150
#' @examples
151+
#' library(GroupSeq)
151152
#' # 1-stage
152153
#' # #######
153154
#' alpha <- 0.05
@@ -184,7 +185,7 @@ seqProb <- function(up,
184185
#' # Increasing max sample size to 98, yields expected n = 69 and power 87.8%
185186
#' res <- seqDesign(pocock, mu=.3, n=98)
186187
#' lapply(unlist(res, recursive=FALSE)[c("n.nkExp", "p.exit")], sum)
187-
#' @export
188+
#' @noRd
188189
seqDesign <- function(crit,
189190
mu = 0, sd = 1,
190191
tau = seq_along(crit) / length(crit),

R/zzz-groupseq-legacy.R

+4
Original file line numberDiff line numberDiff line change
@@ -6428,6 +6428,10 @@ guiMode <- function()
64286428
pkg.env$taskWindow <- tcltk::tktoplevel()
64296429
taskWindow <- pkg.env$taskWindow
64306430

6431+
logofile <- system.file("img", "logo32.gif", package = "GroupSeq")
6432+
tkimage.create("photo", "::image::logoIcon", file = logofile)
6433+
tcl("wm", "iconphoto", taskWindow, "-default", "::image::logoIcon")
6434+
64316435
tkwm.title(taskWindow,"Choose a Task")
64326436
listBoxTasks<-tklistbox(taskWindow,height=4,width=40,selectmode="single",background="white")
64336437
tkgrid(tklabel(taskWindow,text="Select a Task!"))

README.Rmd

+47-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
---
22
output: github_document
3+
4+
bibliography: vignettes/references.bib
5+
link-citations: yes
36
---
47

58
<!-- README.md is generated from README.Rmd. Please edit that file -->
69

710
```{r, include = FALSE}
11+
library(knitr)
12+
813
knitr::opts_chunk$set(
914
collapse = TRUE,
1015
comment = "#",
1116
prompt = F,
1217
fig.path = "images/README-",
1318
tidy = FALSE,
1419
cache = FALSE,
20+
dpi = 300,
1521
out.width = "100%"
1622
)
1723
@@ -34,19 +40,12 @@ options(width = 100L)
3440

3541
GroupSeq computes probabilities related to group sequential designs for normally
3642
distributed test statistics. It enables to derive critical boundaries, power,
37-
drift, and confidence intervals of such designs and supports the alpha
38-
spending approach by Lan-DeMets.
39-
40-
41-
### Installation
42-
43-
```{r, eval = FALSE}
44-
# Install release version from CRAN
45-
install.packages("GroupSeq")
43+
drift, and confidence intervals of such designs, mostly using the
44+
alpha spending approach of @pmid7973215.
4645

47-
# Install development version from GitHub
48-
devtools::install_github("rpahl/GroupSeq")
49-
```
46+
The main motivation for the development of this package was to make this area
47+
of statistics freely available for a broad audience, which is one of the
48+
reasons why all functionality is provided by a graphical user interface.
5049

5150

5251
### Installation
@@ -67,5 +66,40 @@ Load the library to start the graphical user interface.
6766
library("GroupSeq")
6867
```
6968

70-
<img src="man/figures/menu-after-load.png" align="left"/>
69+
```{r, out.width = "30%", echo = FALSE}
70+
include_graphics("man/figures/menu-after-load.png")
71+
```
72+
73+
<br>
74+
75+
To get started see the
76+
[General Introduction](https://rpahl.github.io/GroupSeq/articles/GroupSeq.html)
77+
page.
78+
79+
80+
### Alternative tools
81+
82+
Since the package was written back in 2005, the
83+
graphical user interface may appear a bit outdated. Still, it does it's job and
84+
at least has stood the test of time[$^1$](#refs).
85+
Luckily in recent years others have started to
86+
develop R-based tools with graphical user interface and similar (and more)
87+
statistical functionality:
88+
89+
* [gsDesign](https://CRAN.R-project.org/package=gsDesign) with a free
90+
[shiny web interface](https://gsdesign.shinyapps.io/prod/) including tutorials.
91+
* [rpact](https://CRAN.R-project.org/package=rpact) also with a free
92+
[shiny web interface](https://rpact.shinyapps.io/public) and lots of
93+
[vignettes](https://www.rpact.com/vignettes).
94+
95+
96+
### References {#refs}
97+
98+
<div id="refs"></div>
99+
100+
---
71101

102+
1. The package author is considering to
103+
work on a second version with more functionality and a revised user interface
104+
in the near future. Feel free to request new features
105+
[here](https://github.com/rpahl/GroupSeq/issues).

README.md

+50-12
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@
1616

1717
GroupSeq computes probabilities related to group sequential designs for
1818
normally distributed test statistics. It enables to derive critical
19-
boundaries, power, drift, and confidence intervals of such designs and
20-
supports the alpha spending approach by Lan-DeMets.
19+
boundaries, power, drift, and confidence intervals of such designs,
20+
mostly using the alpha spending approach of [DeMets and
21+
Lan](#ref-pmid7973215) ([1994](#ref-pmid7973215)).
2122

22-
### Installation
23-
24-
``` r
25-
# Install release version from CRAN
26-
install.packages("GroupSeq")
27-
28-
# Install development version from GitHub
29-
devtools::install_github("rpahl/GroupSeq")
30-
```
23+
The main motivation for the development of this package was to make this
24+
area of statistics freely available for a broad audience, which is one
25+
of the reasons why all functionality is provided by a graphical user
26+
interface.
3127

3228
### Installation
3329

@@ -47,4 +43,46 @@ Load the library to start the graphical user interface.
4743
library("GroupSeq")
4844
```
4945

50-
<img src="man/figures/menu-after-load.png" align="left"/>
46+
<img src="man/figures/menu-after-load.png" width="30%" />
47+
48+
<br>
49+
50+
To get started see the [General
51+
Introduction](https://rpahl.github.io/GroupSeq/articles/GroupSeq.html)
52+
page.
53+
54+
### Alternative tools
55+
56+
Since the package was written back in 2005, the graphical user interface
57+
may appear a bit outdated. Still, it does it’s job and at least has
58+
stood the test of time[<sup>1</sup>](#refs). Luckily in recent years
59+
others have started to develop R-based tools with graphical user
60+
interface and similar (and more) statistical functionality:
61+
62+
- [gsDesign](https://CRAN.R-project.org/package=gsDesign) with a free
63+
[shiny web interface](https://gsdesign.shinyapps.io/prod/) including
64+
tutorials.
65+
- [rpact](https://CRAN.R-project.org/package=rpact) also with a free
66+
[shiny web interface](https://rpact.shinyapps.io/public) and lots of
67+
[vignettes](https://www.rpact.com/vignettes).
68+
69+
### References
70+
71+
<div id="refs" class="references csl-bib-body hanging-indent">
72+
73+
<div id="ref-pmid7973215" class="csl-entry">
74+
75+
DeMets, D. L., and K. K. Lan. 1994. “<span class="nocase">Interim
76+
analysis: the alpha spending function approach</span>.” *Stat Med* 13
77+
(13-14): 1341–52. <https://doi.org/10.1002/sim.4780131308>.
78+
79+
</div>
80+
81+
</div>
82+
83+
------------------------------------------------------------------------
84+
85+
1. The package author is considering to work on a second version with
86+
more functionality and a revised user interface in the near future.
87+
Feel free to request new features
88+
[here](https://github.com/rpahl/GroupSeq/issues).

_pkgdown.yml

+39-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ authors:
1010
href: https://rpahl.github.io/r-some-blog/about.html
1111

1212

13+
articles:
14+
- title: "Overview"
15+
contents:
16+
- "understanding-gs-designs"
17+
- "GroupSeq"
18+
- "task-1-compute-bounds-H0"
19+
- "task-2-compute-drift"
20+
- "task-3-compute-bounds-H1"
21+
- "task-4-compute-CI"
22+
23+
home:
24+
links:
25+
- text: Visit my R blog
26+
href: https://rpahl.github.io/r-some-blog/
27+
1328
navbar:
1429
title: "GroupSeq"
1530
left:
@@ -21,7 +36,29 @@ navbar:
2136
href: reference/index.html
2237
- text: "Changelog"
2338
href: news/index.html
24-
- text: "All Packages"
39+
- text: "Articles"
40+
menu:
41+
- title: "Overview"
42+
- text: "Overview"
43+
href: articles/index.html
44+
- text: "---"
45+
- text: "Understanding group sequential designs"
46+
href: articles/understanding-gs-designs.html
47+
- text: "Introduction to GroupSeq"
48+
href: articles/GroupSeq.html
49+
- text: "-1- Compute Bounds"
50+
href: articles/task-1-compute-bounds-H0.html
51+
- text: "-2- Compute Drift given Power and Bounds"
52+
href: articles/task-2-compute-drift.html
53+
- text: "-3- Compute Probabilities given Bounds and Drift"
54+
href: articles/task-3-compute-bounds-H1.html
55+
- text: "-4- Compute Confidence Interval"
56+
href: articles/task-4-compute-CI.html
57+
- text: "---"
58+
- text: "Other"
59+
- text: "GroupSeq article in R News 2006"
60+
href: "https://www.r-project.org/doc/Rnews/Rnews_2006-2.pdf#page=21"
61+
- text: "My Packages"
2562
menu:
2663
- text: "container"
2764
href: https://rpahl.github.io/container/
@@ -36,3 +73,4 @@ navbar:
3673
href: https://twitter.com/romanpahl
3774
- icon: fas fa-blog
3875
href: https://rpahl.github.io/r-some-blog/
76+

0 commit comments

Comments
 (0)