From 2e75a7a8067726a0c97e8846f04123f71d14ae14 Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 28 Jun 2020 21:34:48 +0200 Subject: [PATCH 1/2] Should allow to change point_size in ggplot --- R/blandr.draw.r | 1 + R/blandr.plot.ggplot.r | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/R/blandr.draw.r b/R/blandr.draw.r index a860aab..5e7cf17 100644 --- a/R/blandr.draw.r +++ b/R/blandr.draw.r @@ -90,6 +90,7 @@ blandr.draw <- function( method1 , ciShading = ciShading , normalLow = normalLow , normalHigh = normalHigh , + point_size = point_size , overlapping = overlapping , x.plot.mode = x.plot.mode , y.plot.mode = y.plot.mode , diff --git a/R/blandr.plot.ggplot.r b/R/blandr.plot.ggplot.r index 86a8765..4260ad7 100644 --- a/R/blandr.plot.ggplot.r +++ b/R/blandr.plot.ggplot.r @@ -12,6 +12,7 @@ #' @param ciShading (Optional) TRUE/FALSE switch to plot confidence interval shading to plot, default is TRUE #' @param normalLow (Optional) If there is a normal range, entering a continuous variable will plot a vertical line on the plot to indicate its lower boundary #' @param normalHigh (Optional) If there is a normal range, entering a continuous variable will plot a vertical line on the plot to indicate its higher boundary +#' @param point_size (Optional) Change the size of the points in the plot, default "0.8"' #' @param overlapping (Optional) TRUE/FALSE switch to increase size of plotted point if multiple values using ggplot's geom_count, deafault=FALSE. Not currently recommend until I can tweak the graphics to make them better #' @param x.plot.mode (Optional) Switch to change x-axis from being plotted by means (="means") or by either 1st method (="method1") or 2nd method (="method2"). Default is "means". Anything other than "means" will switch to default mode. #' @param y.plot.mode (Optional) Switch to change y-axis from being plotted by difference (="difference") or by proportion magnitude of measurements (="proportion"). Default is "difference". Anything other than "proportional" will switch to default mode. @@ -56,6 +57,7 @@ blandr.plot.ggplot <- function ( statistics.results , normalLow = FALSE , normalHigh = FALSE , overlapping = FALSE , + point_size = 0.8 , x.plot.mode = "means" , y.plot.mode = "difference" , plotProportionalBias = FALSE , @@ -94,7 +96,7 @@ blandr.plot.ggplot <- function ( statistics.results , # Plot using ggplot ba.plot <- ggplot( plot.data , aes( x = plot.data$x.axis , y = plot.data$y.axis ) ) + - geom_point() + + geom_point(point_size = point_size) + theme(plot.title = element_text(hjust = 0.5)) + geom_hline( yintercept = 0 , linetype = 1 ) + # "0" line geom_hline( yintercept = statistics.results$bias , linetype = 2 ) + # Bias From a3d889fe656590a2316fa5b640d8898cf4b4e58a Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 28 Jun 2020 21:52:13 +0200 Subject: [PATCH 2/2] fixed point_size to size --- R/blandr.plot.ggplot.r | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/blandr.plot.ggplot.r b/R/blandr.plot.ggplot.r index 4260ad7..258725f 100644 --- a/R/blandr.plot.ggplot.r +++ b/R/blandr.plot.ggplot.r @@ -96,7 +96,7 @@ blandr.plot.ggplot <- function ( statistics.results , # Plot using ggplot ba.plot <- ggplot( plot.data , aes( x = plot.data$x.axis , y = plot.data$y.axis ) ) + - geom_point(point_size = point_size) + + geom_point(size = point_size) + theme(plot.title = element_text(hjust = 0.5)) + geom_hline( yintercept = 0 , linetype = 1 ) + # "0" line geom_hline( yintercept = statistics.results$bias , linetype = 2 ) + # Bias