Skip to content

Commit 8677d50

Browse files
committed
Fix partial argument warnings
1 parent aa705ca commit 8677d50

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

R/ppc-intervals.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ label_x <- function(x) {
298298
grouped_d,
299299
outer_width = prob_outer,
300300
inner_width = prob,
301-
ll = quantile(!! val_col, prob = probs[1]),
302-
l = quantile(!! val_col, prob = probs[2]),
303-
m = quantile(!! val_col, prob = probs[3]),
304-
h = quantile(!! val_col, prob = probs[4]),
305-
hh = quantile(!! val_col, prob = probs[5])
301+
ll = quantile(!! val_col, probs = probs[1]),
302+
l = quantile(!! val_col, probs = probs[2]),
303+
m = quantile(!! val_col, probs = probs[3]),
304+
h = quantile(!! val_col, probs = probs[4]),
305+
hh = quantile(!! val_col, probs = probs[5])
306306
))
307307
}
308308

tests/testthat/test-helpers-shared.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,51 +30,51 @@ all_pars <- c("param_1", "param_2",
3030

3131
test_that("select_parameters throws errors if 'explicit' not found", {
3232
expect_error(select_parameters(explicit = c("alpha", "ALPHA"),
33-
complete = all_pars),
33+
complete_pars = all_pars),
3434
"don't match parameter names: ALPHA")
3535
expect_error(select_parameters(c("BETA", "ALPHA"), complete = all_pars),
3636
"don't match parameter names: BETA, ALPHA")
3737
})
3838
test_that("select_parameters throws errors if no regex matches", {
3939
expect_error(select_parameters(explicit = c("alpha", "beta"),
4040
patterns = "tomato|apple",
41-
complete = all_pars),
41+
complete_pars = all_pars),
4242
"No matches for 'regex_pars'")
4343
})
4444

4545
test_that("select_parameters works with regex", {
4646
expect_identical(select_parameters(patterns = "param", complete = all_pars),
4747
all_pars[-c(7:8)])
4848

49-
expect_identical(select_parameters(patterns = c("param", "tomato"), complete = all_pars),
49+
expect_identical(select_parameters(patterns = c("param", "tomato"), complete_pars = all_pars),
5050
all_pars[-c(7:8)])
5151

52-
expect_identical(select_parameters(patterns = c("param\\[", "tomato"), complete = all_pars),
52+
expect_identical(select_parameters(patterns = c("param\\[", "tomato"), complete_pars = all_pars),
5353
all_pars[3:6])
5454

55-
expect_identical(select_parameters(patterns = c("param\\_"), complete = all_pars),
55+
expect_identical(select_parameters(patterns = c("param\\_"), complete_pars = all_pars),
5656
all_pars[1:2])
5757
})
5858

5959
test_that("select_parameters works without regex", {
60-
expect_identical(select_parameters(explicit = "alpha", complete = all_pars),
60+
expect_identical(select_parameters(explicit = "alpha", complete_pars = all_pars),
6161
"alpha")
62-
expect_identical(select_parameters(c("alpha", "param[1,3,5]"), complete = all_pars),
62+
expect_identical(select_parameters(c("alpha", "param[1,3,5]"), complete_pars = all_pars),
6363
c("alpha", "param[1,3,5]"))
6464
})
6565

6666
test_that("select_parameters works with both explicit and regex", {
6767
expect_identical(select_parameters(explicit = "alpha",
6868
patterns = "param",
69-
complete = all_pars),
69+
complete_pars = all_pars),
7070
c("alpha", all_pars[-c(7:8)]))
7171
expect_identical(select_parameters(explicit = "alpha",
7272
patterns = "alpha",
73-
complete = all_pars),
73+
complete_pars = all_pars),
7474
"alpha")
7575
expect_identical(select_parameters(explicit = c("alpha", "beta"),
7676
patterns = "param\\[|param\\_",
77-
complete = all_pars),
77+
complete_pars = all_pars),
7878
c(all_pars[7:8], all_pars[-c(7:8)]))
7979
})
8080

tests/testthat/test-mcmc-diagnostics.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ test_that("mcmc_acf & mcmc_acf_bar throw correct errors", {
105105
test_that("mcmc_rhat renders correctly", {
106106
testthat::skip_on_cran()
107107

108-
rhats <- seq(from = 1, to = 1.20, length = 10)
108+
rhats <- seq(from = 1, to = 1.20, length.out = 10)
109109

110110
p_base <- mcmc_rhat(rhats)
111111
vdiffr::expect_doppelganger("mcmc_rhat (default)", p_base)
@@ -117,7 +117,7 @@ test_that("mcmc_rhat renders correctly", {
117117
test_that("mcmc_rhat_hist renders correctly", {
118118
testthat::skip_on_cran()
119119

120-
rhats <- seq(from = 1, to = 1.20, length = 10)
120+
rhats <- seq(from = 1, to = 1.20, length.out = 10)
121121

122122
p_base <- mcmc_rhat_hist(rhats)
123123
vdiffr::expect_doppelganger("mcmc_rhat_hist (default)", p_base)
@@ -130,7 +130,7 @@ test_that("mcmc_rhat_hist renders correctly", {
130130
test_that("mcmc_neff renders correctly", {
131131
testthat::skip_on_cran()
132132

133-
neffs <- seq(from = 0, to = 1, length = 20)
133+
neffs <- seq(from = 0, to = 1, length.out = 20)
134134

135135
p_base <- mcmc_neff(neffs)
136136
vdiffr::expect_doppelganger("mcmc_neff (default)", p_base)
@@ -139,7 +139,7 @@ test_that("mcmc_neff renders correctly", {
139139
test_that("mcmc_neff_hist renders correctly", {
140140
testthat::skip_on_cran()
141141

142-
neffs <- seq(from = 0, to = 1, length = 20)
142+
neffs <- seq(from = 0, to = 1, length.out = 20)
143143

144144
p_base <- mcmc_neff_hist(neffs)
145145
vdiffr::expect_doppelganger("mcmc_neff_hist (default)", p_base)

tests/testthat/test-mcmc-intervals.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ test_that("mcmc_intervals renders correctly", {
187187
p_inner <- mcmc_intervals(vdiff_dframe, prob = .1)
188188
vdiffr::expect_doppelganger("mcmc_intervals (inner)", p_inner)
189189

190-
rhats <- seq(from = 1, to = 1.15, length = 5)
190+
rhats <- seq(from = 1, to = 1.15, length.out = 5)
191191
p_rhats <- mcmc_intervals(vdiff_dframe, rhat = rhats)
192192
vdiffr::expect_doppelganger("mcmc_intervals (rhats)", p_rhats)
193193

@@ -216,7 +216,7 @@ test_that("mcmc_areas renders correctly", {
216216
p_inner <- mcmc_areas(vdiff_dframe, prob = .1)
217217
vdiffr::expect_doppelganger("mcmc_areas (inner)", p_inner)
218218

219-
rhats <- seq(from = 1, to = 1.15, length = 5)
219+
rhats <- seq(from = 1, to = 1.15, length.out = 5)
220220
p_rhats <- mcmc_areas(vdiff_dframe, rhat = rhats)
221221
vdiffr::expect_doppelganger("mcmc_areas (rhats)", p_rhats)
222222

0 commit comments

Comments
 (0)