Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should allow to change point_size in ggplot #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/blandr.draw.r
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down
4 changes: 3 additions & 1 deletion R/blandr.plot.ggplot.r
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ,
Expand Down Expand Up @@ -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(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
Expand Down