Skip to content

Commit d386f0b

Browse files
authored
Merge pull request #642 from remlapmot/ggplot2-v4-2
TwoSampleMR 0.6.19
2 parents 49061c9 + c4d766f commit d386f0b

File tree

8 files changed

+15
-8
lines changed

8 files changed

+15
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: TwoSampleMR
22
Title: Two Sample MR Functions and Interface to MRC Integrative
33
Epidemiology Unit OpenGWAS Database
4-
Version: 0.6.18
4+
Version: 0.6.19
55
Authors@R: c(
66
person("Gibran", "Hemani", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0003-0920-1055")),

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# TwoSampleMR v0.6.19
2+
3+
(Release date 2025-07-21)
4+
5+
* Further fixes for the forthcoming version 4 of ggplot2.
6+
17
# TwoSampleMR v0.6.18
28

39
(Release date 2025-07-15)

R/forest_plot2.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ forest_plot_basic <- function(dat, section=NULL, colour_group=NULL, colour_group
339339
ggplot2::geom_rect(ggplot2::aes(fill=col), xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf) +
340340
ggplot2::geom_vline(xintercept=seq(ceiling(lo_orig), ceiling(up), by=0.5), colour="white", size=0.3) +
341341
ggplot2::geom_vline(xintercept=null_line, colour="#333333", size=0.3) +
342-
ggplot2::geom_errorbarh(ggplot2::aes(xmin=lo_ci, xmax=up_ci), width=0, size=0.4, colour="#aaaaaa") +
342+
ggplot2::geom_errorbar(ggplot2::aes(xmin=lo_ci, xmax=up_ci), width=0, size=0.4, colour="#aaaaaa", orientation = "y") +
343343
ggplot2::geom_point(colour="black", size=2.2) +
344344
point_plot +
345345
ggplot2::facet_grid(lab ~ .) +

R/forest_plot_1-to-many.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ forest_plot_basic2 <- function(dat, section=NULL, colour_group=NULL, colour_grou
346346
ggplot2::geom_vline(xintercept=seq(ceiling(lo_orig), ceiling(up), by=0.5), alpha=0, linewidth=0.3) +
347347
ggplot2::geom_vline(xintercept=null_line, colour="#333333", linewidth=0.3) +
348348
# ggplot2::geom_errorbarh(ggplot2::aes(xmin=lo_ci, xmax=up_ci), height=0, size=0.4, colour="#aaaaaa") +
349-
ggplot2::geom_errorbarh(ggplot2::aes(xmin=lo_ci, xmax=up_ci), width=0, linewidth=0.4, colour=colour_scheme) +
349+
ggplot2::geom_errorbar(ggplot2::aes(xmin=lo_ci, xmax=up_ci), width=0, linewidth=0.4, colour=colour_scheme, orientation = "y") +
350350
# ggplot2::geom_point(colour="black", size=2.2) +
351351
ggplot2::geom_point(colour=colour_scheme, size=2.2,shape=shape_points,fill=colour_scheme) +
352352
# ggplot2::scale_fill_manual(values="cyan4")+

R/leaveoneout.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ mr_leaveoneout_plot <- function(leaveoneout_results)
129129
ggplot2::ggplot(d, ggplot2::aes(y=SNP, x=b)) +
130130
ggplot2::geom_vline(xintercept=0, linetype="dotted") +
131131
# ggplot2::geom_errorbarh(ggplot2::aes(xmin=pmax(lo, min(d$b, na.rm=T)), xmax=pmin(up, max(d$b, na.rm=T)), size=as.factor(tot), colour=as.factor(tot)), height=0) +
132-
ggplot2::geom_errorbarh(ggplot2::aes(xmin=lo, xmax=up, linewidth=as.factor(tot), colour=as.factor(tot)), width=0) +
132+
ggplot2::geom_errorbar(ggplot2::aes(xmin=lo, xmax=up, linewidth=as.factor(tot), colour=as.factor(tot)), width=0, orientation = "y") +
133133
ggplot2::geom_point(ggplot2::aes(colour=as.factor(tot))) +
134134
ggplot2::geom_hline(ggplot2::aes(yintercept = which(levels(SNP) %in% "")), colour="grey") +
135135
ggplot2::scale_colour_manual(values=c("black", "red")) +

R/scatterplot.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,14 @@ mr_scatter_plot <- function(mr_results, dat) {
118118
colour = "grey",
119119
width = 0
120120
) +
121-
ggplot2::geom_errorbarh(
121+
ggplot2::geom_errorbar(
122122
ggplot2::aes(
123123
xmin = beta.exposure - se.exposure,
124124
xmax = beta.exposure + se.exposure
125125
),
126126
colour = "grey",
127-
width = 0
127+
width = 0,
128+
orientation = "y"
128129
) +
129130
ggplot2::geom_point() +
130131
ggplot2::geom_abline(

R/singlesnp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ mr_forest_plot <- function(singlesnp_results, exponentiate=FALSE)
131131
ggplot2::ggplot(d, ggplot2::aes(y=SNP, x=b)) +
132132
ggplot2::geom_vline(xintercept=xint, linetype="dotted") +
133133
# ggplot2::geom_errorbarh(ggplot2::aes(xmin=pmax(lo, min(d$b, na.rm=T)), xmax=pmin(up, max(d$b, na.rm=T)), size=as.factor(tot), colour=as.factor(tot)), height=0) +
134-
ggplot2::geom_errorbarh(ggplot2::aes(xmin=lo, xmax=up, linewidth=as.factor(tot), colour=as.factor(tot)), width=0) +
134+
ggplot2::geom_errorbar(ggplot2::aes(xmin=lo, xmax=up, linewidth=as.factor(tot), colour=as.factor(tot)), width=0, orientation = "y") +
135135
ggplot2::geom_point(ggplot2::aes(colour=as.factor(tot))) +
136136
ggplot2::geom_hline(ggplot2::aes(yintercept = which(levels(SNP) %in% "")), colour="grey") +
137137
ggplot2::scale_colour_manual(values=c("black", "red")) +

tests/testthat/test_plots.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test_that("Forest plot 1 to many", {
7474

7575
test_that("Forest plot 1 to many test 2", {
7676
res$pval<-formatC(res$pval, format = "e", digits = 2)
77-
expect_warning(p9 <- utils::capture.output(forest_plot_1_to_many(
77+
expect_warning(utils::capture.output(p9 <- forest_plot_1_to_many(
7878
res,
7979
b = "b",
8080
se = "se",

0 commit comments

Comments
 (0)