Skip to content

Commit 0bd253e

Browse files
authored
CRAN updates (#26)
* remove imports handled by BayesTools and suppress start-up message * update unit tests * update ggplot2 aes_string
1 parent 3a2995c commit 0bd253e

File tree

145 files changed

+1475
-1442
lines changed

Some content is hidden

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

145 files changed

+1475
-1442
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ RoBMA.Rcheck
1717
.Rprofile
1818
/doc/
1919
/Meta/
20+
models/MetaRegression/*

DESCRIPTION

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: RoBMA
22
Title: Robust Bayesian Meta-Analyses
3-
Version: 2.3.1
3+
Version: 2.3.2
44
Maintainer: František Bartoš <f.bartos96@gmail.com>
55
Authors@R: c(
66
person("František", "Bartoš", role = c("aut", "cre"),
@@ -34,24 +34,22 @@ License: GPL-3
3434
Encoding: UTF-8
3535
LazyData: true
3636
Roxygen: list(markdown = TRUE)
37-
RoxygenNote: 7.2.0
37+
RoxygenNote: 7.2.3
3838
SystemRequirements: JAGS >= 4.3.1 (https://mcmc-jags.sourceforge.io/)
3939
NeedsCompilation: yes
4040
Depends:
4141
R (>= 4.0.0)
4242
Imports:
4343
BayesTools (>= 0.2.0),
4444
runjags,
45-
bridgesampling,
4645
rjags,
4746
coda,
48-
psych,
4947
stats,
5048
graphics,
51-
extraDistr,
5249
mvtnorm,
5350
scales,
5451
Rdpack,
52+
rlang,
5553
ggplot2
5654
Suggests:
5755
parallel,

NAMESPACE

+2
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ importFrom(BayesTools,is.prior.none)
7373
importFrom(BayesTools,is.prior.point)
7474
importFrom(BayesTools,is.prior.simple)
7575
importFrom(BayesTools,is.prior.weightfunction)
76+
importFrom(Rdpack,reprompt)
77+
importFrom(rlang,.data)

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## version 2.3.2
2+
### Fixes
3+
- suppressing start-up message
4+
- cleaning up imports
5+
16
## version 2.3.1
27
### Fixes
38
- fixing weighted meta-analysis parameterization

R/RoBMA-package.R

+2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@
2525
##'
2626
##' @references \insertAllCited{}
2727
##' @importFrom BayesTools is.prior is.prior.none is.prior.point is.prior.simple is.prior.PET is.prior.PEESE is.prior.weightfunction
28+
##' @importFrom Rdpack reprompt
29+
##' @importFrom rlang .data
2830
"_PACKAGE"
2931

R/diagnostics.R

+27-7
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,17 @@ diagnostics <- function(fit, parameter, type, plot_type = "base", show_models =
199199

200200
}else if(plot_type == "ggplot"){
201201

202-
graph <- ggplot2::ggplot(plot_data$samp, ggplot2::aes_string(x = "iteration", y = "value", color = "chain")) +
202+
graph <- ggplot2::ggplot(
203+
data = data.frame(
204+
x = plot_data$samp$iteration,
205+
y = plot_data$samp$value,
206+
color = plot_data$samp$chain),
207+
mapping = ggplot2::aes(
208+
x = .data[["x"]],
209+
y = .data[["y"]],
210+
color = .data[["color"]])) +
203211
ggplot2::geom_path() +
204-
ggplot2::scale_color_manual(values = .diagnostics_color(plot_data$nchains))
212+
ggplot2::scale_color_manual(name = "chain", values = .diagnostics_color(plot_data$nchains))
205213
temp_x_range <- range(plot_data$samp$iteration)
206214
temp_y_range <- range(plot_data$samp$value)
207215
graph <- graph + ggplot2::scale_x_continuous(
@@ -283,9 +291,15 @@ diagnostics <- function(fit, parameter, type, plot_type = "base", show_models =
283291

284292
}else if(plot_type == "ggplot"){
285293

286-
graph <- ggplot2::ggplot(plot_data$samp, ggplot2::aes_string(x = "value")) +
287-
ggplot2::geom_density(mapping = ggplot2::aes_string(fill = "chain"), color = "black", alpha = .5) +
288-
ggplot2::scale_fill_manual(values = .diagnostics_color(plot_data$nchains))
294+
graph <- ggplot2::ggplot(
295+
data = data.frame(
296+
x = plot_data$samp$value,
297+
fill = plot_data$samp$chain),
298+
mapping = ggplot2::aes(
299+
x = .data[["x"]],
300+
fill = .data[["fill"]])) +
301+
ggplot2::geom_density(color = "black", alpha = .5) +
302+
ggplot2::scale_fill_manual(name = "chain", values = .diagnostics_color(plot_data$nchains))
289303
temp_y_max <- max(ggplot2::ggplot_build(graph)$data[[1]]$density)
290304
temp_x_range <- if(par == "omega") c(0, 1) else range(plot_data$samp$value)
291305
graph <- graph + ggplot2::scale_y_continuous(
@@ -339,8 +353,14 @@ diagnostics <- function(fit, parameter, type, plot_type = "base", show_models =
339353
graph <- NULL
340354

341355
}else if(plot_type == "ggplot"){
342-
graph <- ggplot2::ggplot(ac_dat, ggplot2::aes_string(x = "lag", y = "ac")) +
343-
ggplot2::geom_bar(size = .5, color = "black", fill = "#B2001D", position = "dodge", stat = "summary", fun = "mean") +
356+
graph <- ggplot2::ggplot(
357+
data = data.frame(
358+
x = ac_dat$lag,
359+
y = ac_dat$ac),
360+
mapping = ggplot2::aes(
361+
x = .data[["x"]],
362+
y = .data[["y"]])) +
363+
ggplot2::geom_bar(linewidth = .5, color = "black", fill = "#B2001D", position = "dodge", stat = "summary", fun = "mean") +
344364
ggplot2::scale_y_continuous(breaks = seq(0, 1, 0.25)) +
345365
ggplot2::labs(x = "Lag", y = "Avg. autocorrelation")
346366
if(!is.null(title)){

R/utilities.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ RoBMA.get_option <- function(name){
4747
return(eval(RoBMA.private[[name]]))
4848
}
4949

50-
50+
# export the function directly to suppress import warnings
51+
.runjags__findjags <- function() runjags::findjags()
5152

5253
# adapted from the runjags package version 2.2.0
5354
RoBMA.private <- new.env()
5455
# Use 'expression' for functions to avoid having to evaluate before the package is fully loaded:
5556
assign("defaultoptions", list(
56-
jagspath = expression(runjags::findjags()),
57+
jagspath = expression(.runjags__findjags()),
5758
envir = RoBMA.private))
5859

5960
assign("options", RoBMA.private$defaultoptions, envir = RoBMA.private)
@@ -86,6 +87,7 @@ assign("max_cores", parallel::detectCores(logical = TRUE) - 1, envir = Ro
8687
"2.2.3" = c("0.2.3", "999.999.999"),
8788
"2.3.0" = c("0.2.3", "999.999.999"),
8889
"2.3.1" = c("0.2.3", "999.999.999"),
90+
"2.3.2" = c("0.2.3", "999.999.999"),
8991
stop("New RoBMA version needs to be defined in '.check_BayesTools' function!")
9092
)
9193

R/zzz.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
module_location <- NULL
1313
warning('The RoBMA module could not be loaded.', call. = FALSE)
1414
}else{
15-
rjags::load.module("RoBMA", path = module_location)
15+
rjags::load.module("RoBMA", path = module_location, quiet = TRUE)
16+
if(!"RoBMA" %in% rjags::list.modules()){
17+
warning('The RoBMA module could not be loaded.', call. = FALSE)
18+
}
1619
}
1720

1821
RoBMA.private$module_location <- module_location

man/RoBMA.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/check_setup.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/_snaps/6-plots/ggplot-forest1-1.svg

+5-5
Loading

tests/testthat/_snaps/6-plots/ggplot-forest1-10.svg

+5-5
Loading

tests/testthat/_snaps/6-plots/ggplot-forest1-11.svg

+5-5
Loading

tests/testthat/_snaps/6-plots/ggplot-forest1-12.svg

+5-5
Loading

0 commit comments

Comments
 (0)