Skip to content

Commit 7ff682a

Browse files
2: add basic check workflow (#33)
closes #2
1 parent e2ae812 commit 7ff682a

25 files changed

Lines changed: 99 additions & 166 deletions

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
^cran-comments\.md$
1111
^CRAN-SUBMISSION$
1212
^\.github$
13+
^air.toml$
14+
^\.lintr$

.github/workflows/R-CMD-check.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
R_KEEP_PKG_SOURCE: yes
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::rcmdcheck
28+
needs: check
29+
30+
- uses: r-lib/actions/check-r-package@v2
31+
with:
32+
upload-snapshots: true
33+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ src/*.dll
1212
inst/doc
1313
docs
1414
revdep
15+
tests/testthat/Rplots.pdf

R/Mods.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ Mods <- function(..., doses, placEff = 0, maxEff, direction = c("increasing", "d
201201

202202
#' Extract mean response from set of dose-response models
203203
#'
204-
#' @inheritParams Mods
205204
#' @param fmodels An object of class Mods
206205
#'
207206
#' @rdname Mods
@@ -294,7 +293,6 @@ plotMods <- function(ModsObj, nPoints = 200, superpose = FALSE,
294293

295294
#' Plot dose-response models
296295
#'
297-
#' @inheritParams plotMods
298296
#' @param Delta Delta: The target effect size use for the target dose (TD)
299297
#' (Delta should be > 0).
300298
#' @param x Object of class Mods with type Mods
@@ -486,8 +484,6 @@ TD <- function(object, Delta, TDtype = c("continuous", "discrete"),
486484

487485
#' #' Calculate effective dose for a dose-response model
488486
#'
489-
#' @inheritParams targdose
490-
#'
491487
#' @rdname targdose
492488
#' @export
493489
ED <- function(object, p, EDtype = c("continuous", "discrete"),

R/bFitMod.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ print.bFitMod <- function(x, digits = 3, ...){
233233

234234
#' Make predictions from fitted dose-response model
235235
#'
236-
#' @inheritParams coef.bFitMod
237236
#' @param predType,summaryFct,doseSeq,lenSeq Arguments for the predict method.
238237
#'
239238
#' \samp{predType}: predType determines whether predictions are returned for the dose-response curve or the effect
@@ -286,7 +285,6 @@ predict.bFitMod <- function(object, predType = c("full-model", "effect-curve"),
286285

287286
#' Plot fitted dose-response model
288287
#'
289-
#' @inheritParams coef.bFitMod
290288
#' @param plotType,quant,plotData,level,lenDose Arguments for plot method.
291289
#'
292290
#' \samp{plotType}: Determining whether the dose-response curve or the effect curve should be plotted.

R/drmodels.R

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ emax <- function(dose, e0, eMax, ed50){
1414
}
1515

1616
#' @rdname drmodels
17-
#' @inheritParams emax
1817
#' @param ... Just included for convenience in the gradient functions, so that
1918
#' for example \code{quadratic(dose, e0=0, b1=1, b2=3)} will not throw an error
2019
#' (although the gradient of the quadratic model is independent of e0, b1 and
@@ -26,7 +25,6 @@ emaxGrad <- function(dose, eMax, ed50, ...){
2625
}
2726

2827
#' @rdname drmodels
29-
#' @inheritParams emax
3028
#' @param h Hill parameter, determining the steepness of the model at the ED50
3129
#' @usage NULL
3230
#' @export
@@ -35,7 +33,6 @@ sigEmax <- function(dose, e0, eMax, ed50, h){
3533
}
3634

3735
#' @rdname drmodels
38-
#' @inheritParams sigEmax
3936
#' @usage NULL
4037
#' @export
4138
sigEmaxGrad <- function(dose, eMax, ed50, h, ...){
@@ -48,7 +45,6 @@ sigEmaxGrad <- function(dose, eMax, ed50, h, ...){
4845
}
4946

5047
#' @rdname drmodels
51-
#' @inheritParams emax
5248
#' @param e1 Slope parameter for exponential model
5349
#' @param delta Exponential model: Parameter, controlling the convexity of the
5450
#' model.\cr Linear and linlog model: Slope parameter\cr Logistic model:
@@ -60,15 +56,13 @@ exponential <- function(dose, e0, e1, delta){
6056
}
6157

6258
#' @rdname drmodels
63-
#' @inheritParams exponential
6459
#' @usage NULL
6560
#' @export
6661
exponentialGrad <- function(dose, e1, delta, ...){
6762
cbind(e0=1, e1=exp(dose/delta)-1, delta=-exp(dose/delta) * dose * e1/delta^2)
6863
}
6964

7065
#' @rdname drmodels
71-
#' @inheritParams emax
7266
#' @param b1 first parameter of quadratic model
7367
#' @param b2 second parameter of quadratic model (controls, whether model is
7468
#' convex or concave)
@@ -79,15 +73,13 @@ quadratic <- function(dose, e0, b1, b2){
7973
}
8074

8175
#' @rdname drmodels
82-
#' @inheritParams quadratic
8376
#' @usage NULL
8477
#' @export
8578
quadraticGrad <- function(dose, ...){
8679
cbind(e0=1, b1 = dose, b2 = dose^2)
8780
}
8881

8982
#' @rdname drmodels
90-
#' @inheritParams emax
9183
#' @param delta1 delta1 parameter for beta model
9284
#' @param delta2 delta2 parameter for beta model
9385
#' @param scal Scale parameter (treated as a fixed value, not estimated)
@@ -101,7 +93,6 @@ betaMod <- function(dose, e0, eMax, delta1, delta2, scal){
10193
}
10294

10395
#' @rdname drmodels
104-
#' @inheritParams betaMod
10596
#' @usage NULL
10697
#' @export
10798
betaModGrad <- function(dose, eMax, delta1, delta2, scal, ...){
@@ -119,23 +110,20 @@ betaModGrad <- function(dose, eMax, delta1, delta2, scal, ...){
119110
}
120111

121112
#' @rdname drmodels
122-
#' @inheritParams exponential
123113
#' @usage NULL
124114
#' @export
125115
linear <- function(dose, e0, delta){
126116
e0 + delta * dose
127117
}
128118

129119
#' @rdname drmodels
130-
#' @inheritParams linear
131120
#' @usage NULL
132121
#' @export
133122
linearGrad <- function(dose, ...){
134123
cbind(e0=1, delta=dose)
135124
}
136125

137126
#' @rdname drmodels
138-
#' @inheritParams exponential
139127
#' @param off Offset value to avoid problems with dose=0 (treated as a fixed
140128
#' value, not estimated)
141129
#' @usage NULL
@@ -145,15 +133,13 @@ linlog <- function(dose, e0, delta, off = 1){
145133
}
146134

147135
#' @rdname drmodels
148-
#' @inheritParams linlog
149136
#' @usage NULL
150137
#' @export
151138
linlogGrad <- function(dose, off, ...){
152139
cbind(e0=1, delta=log(dose+off))
153140
}
154141

155142
#' @rdname drmodels
156-
#' @inheritParams emax
157143
#' @param delta Exponential model: Parameter, controlling the convexity of the
158144
#' model.\cr Linear and linlog model: Slope parameter\cr Logistic model:
159145
#' Parameter controlling determining the steepness of the curve
@@ -164,7 +150,6 @@ logistic <- function(dose, e0, eMax, ed50, delta){
164150
}
165151

166152
#' @rdname drmodels
167-
#' @inheritParams logistic
168153
#' @usage NULL
169154
#' @export
170155
logisticGrad <- function(dose, eMax, ed50, delta, ...){
@@ -175,7 +160,6 @@ logisticGrad <- function(dose, eMax, ed50, delta, ...){
175160
}
176161

177162
#' @rdname drmodels
178-
#' @inheritParams emax
179163
#' @param resp Response values at the nodes for the linInt model
180164
#' @param nodes Interpolation nodes for the linear interpolation for the linInt
181165
#' model (treated as a fixed value, not estimated)
@@ -188,7 +172,6 @@ linInt <- function(dose, resp, nodes){
188172
}
189173

190174
#' @rdname drmodels
191-
#' @inheritParams linInt
192175
#' @usage NULL
193176
#' @export
194177
linIntGrad <- function(dose, resp, nodes, ...){

R/fitMod.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,6 @@ coef.DRMod <- function(object, sep = FALSE, ...){
381381

382382
#' Extract dose-response vcov matrix
383383
#'
384-
#' @inheritParams coef.DRMod
385-
#'
386384
#' @rdname fitMod
387385
#' @method vcov DRMod
388386
#' @export
@@ -451,7 +449,6 @@ vcov.DRMod <- function(object, ...){
451449

452450
#'Make predictions from dose-response model
453451
#'
454-
#'@inheritParams coef.DRMod
455452
#'@param predType,newdata,doseSeq,se.fit predType determines whether predictions are returned for the full model
456453
#' (including potential covariates), the ls-means (SAS type) or the effect curve (difference to placebo).
457454
#'
@@ -779,7 +776,6 @@ predict.DRMod <- function(object, predType = c("full-model", "ls-means", "effect
779776

780777
#'Plot fitted dose-response model
781778
#'
782-
#'@inheritParams coef.DRMod
783779
#'@param CI,level,plotData,plotGrid,colMn,colFit Arguments for plot method: \samp{CI} determines whether confidence
784780
#' intervals should be plotted. \samp{level} determines the level of the confidence intervals. \samp{plotData}
785781
#' determines how the data are plotted: Either as means or as means with CI, raw data or none. In case of \samp{type =
@@ -798,8 +794,6 @@ plot.DRMod <- function(x, CI = FALSE, level = 0.95,
798794

799795
#' Extract log-likelihood of dose-response model
800796
#'
801-
#' @inheritParams coef.DRMod
802-
#'
803797
#' @rdname fitMod
804798
#' @method logLik DRMod
805799
#' @export
@@ -822,7 +816,6 @@ logLik.DRMod <- function(object, ...){
822816

823817
#' Extract AIC of dose-response model
824818
#'
825-
#' @inheritParams coef.DRMod
826819
#' @param k Penalty to use for model-selection criterion (AIC uses 2, BIC uses log(n)).
827820
#'
828821
#' @rdname fitMod
@@ -839,8 +832,6 @@ AIC.DRMod <- function(object, ..., k = 2){
839832

840833
#' Extract gAIC of dose-response model
841834
#'
842-
#' @inheritParams AIC.DRMod
843-
#'
844835
#' @rdname fitMod
845836
#' @method gAIC DRMod
846837
#' @export

R/optContr.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ plot.optContr <- function (x, superpose = TRUE, xlab = "Dose",
222222

223223
#' Plot optimal contrasts
224224
#'
225-
#' @inheritParams plot.optContr
226225
#' @param optContrObj For function \samp{plotContr} the \samp{optContrObj}
227226
#' should contain an object of class \samp{optContr}.
228227
#'

R/optDesign.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ optDesign <- function(models, probs, doses,
373373

374374
#' Calculate design criteria for set of designs
375375
#'
376-
#' @inheritParams optDesign
377376
#' @param design Argument for \samp{rndDesign} and \samp{calcCrit} functions: Numeric vector (or matrix) of allocation
378377
#' weights for the different doses. The rows of the matrices need to sum to 1. Alternatively also an object of class
379378
#' "DRdesign" can be used for \samp{rndDesign}. Note that there should be at least as many design points available as
@@ -497,7 +496,6 @@ print.DRdesign <- function(x, digits = 5, eps = 0.001, ...){
497496

498497
#' Efficiently round calculated design to a finite sample size
499498
#'
500-
#' @inheritParams calcCrit
501499
#' @param eps Argument for \samp{rndDesign} function: Value under which elements of w will be regarded as 0.
502500
#' @rdname optDesign
503501
#' @export
@@ -539,7 +537,6 @@ rndDesign <- function(design, n, eps = 0.0001){
539537

540538
#' Plot optimal designs
541539
#'
542-
#' @inheritParams optDesign
543540
#' @param x Object of class \samp{DRdesign} (for \samp{plot.design})
544541
#' @param lwdDes,colDes Line width and color of the lines plotted for the design (in \samp{plot.design})
545542
#'

R/planMod.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ print.summary.planMod <- function(x, digits = 3, len = 101,
421421

422422
#' Plot to summarize dose-response and dose estimations
423423
#'
424-
#' @inheritParams plot.planMod
425424
#' @param x An object of class planMod
426425
#' @param type Type of plot to produce
427426
#' @param placAdj When \samp{type = "dose-response"}, this determines whether dose-response estimates are shown on

0 commit comments

Comments
 (0)