diff --git a/DESCRIPTION b/DESCRIPTION index e84492a..1008c8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,7 +24,6 @@ Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3.9000 URL: http://grantmcdermott.com/ggiplot/ BugReports: https://github.com/grantmcdermott/ggiplot/issues -Remotes: lrberge/fixest Depends: ggplot2 (>= 2.2.0) Imports: diff --git a/R/ggiplot.R b/R/ggiplot.R index 8defd4a..895a6a9 100644 --- a/R/ggiplot.R +++ b/R/ggiplot.R @@ -41,7 +41,7 @@ #' example, `zero.par = list(col = 'orange')`. #' * `ref.line` and `ref.line.par` for defining or adjusting the vertical #' reference line. For example, `ref.line.par = list(col = 'red', lty = 4)`. -#' * `pt.pch` and `pt.join` for overriding the default point estimate shapes and joining them, respectively. +#' * `pt.pch`, `pt.size`, and `pt.join` for overriding the default point estimate shapes, size, and joining them, respectively. #' * `col` for manually defining line, point, and ribbon colours. #' * `ci_level` for changing the desired confidence level (default = 0.95). #' Note that multiple levels are allowed, e.g. `ci_level = c(0.8, 0.95)`. @@ -321,6 +321,7 @@ ggiplot = function( dict = if (!is.null(dots[['dict']])) dots[['dict']] else fixest::getFixest_dict() col = if (!is.null(dots[['col']])) dots[['col']] else NULL pt.pch = if (!is.null(dots[['pt.pch']])) dots[['pt.pch']] else NULL + pt.size = if (!is.null(dots[['pt.size']])) dots[['pt.size']] else 2.5 # Hard-coded as 2.5 based on dicussion here: https://github.com/grantmcdermott/ggiplot/pull/27#issuecomment-1837850786 pt.join = if (!is.null(dots[['pt.join']])) dots[['pt.join']] else FALSE ## hold off deciding zero line until we have seen the data # zero = if (!is.null(dots[['zero']])) dots[['zero']] else TRUE @@ -454,9 +455,9 @@ ggiplot = function( names(pt_values) = pt_values_df$group } - ptsize = 2.5 + if (multi_style == "facet") { - ptsize = ptsize - 0.25 * n_fcts + pt.size = pt.size - 0.25 * n_fcts } if (multi_style == "none") { @@ -619,35 +620,35 @@ ggiplot = function( if (multi_style == "dodge") { if (length(ci_level) == 1) { geom_point( - shape = pt.pch, size = ptsize, + shape = pt.pch, size = pt.size, position = position_dodge2(width = ci.width, padding = ci.width) ) } else { geom_point( data = ~ subset(.x, ci_level == max(ci_level)), - shape = pt.pch, size = ptsize, + shape = pt.pch, size = pt.size, position = position_dodge2(width = ci.width, padding = ci.width) ) } } else { - geom_point(shape = pt.pch, size = ptsize) + geom_point(shape = pt.pch, size = pt.size) } } else { if (multi_style == "dodge") { if (length(ci_level) == 1) { geom_point( - size = ptsize, + size = pt.size, position = position_dodge2(width = ci.width, padding = ci.width) ) } else { geom_point( data = ~ subset(.x, ci_level == max(ci_level)), - size = ptsize, + size = pt.size, position = position_dodge2(width = ci.width, padding = ci.width) ) } } else { - geom_point(size = ptsize) + geom_point(size = pt.size) } } } diff --git a/man/ggiplot.Rd b/man/ggiplot.Rd index 7376e4d..06a8198 100644 --- a/man/ggiplot.Rd +++ b/man/ggiplot.Rd @@ -66,7 +66,7 @@ require list objects. Currently used are: example, \code{zero.par = list(col = 'orange')}. \item \code{ref.line} and \code{ref.line.par} for defining or adjusting the vertical reference line. For example, \code{ref.line.par = list(col = 'red', lty = 4)}. -\item \code{pt.pch} and \code{pt.join} for overriding the default point estimate shapes and joining them, respectively. +\item \code{pt.pch}, \code{pt.size}, and \code{pt.join} for overriding the default point estimate shapes, size, and joining them, respectively. \item \code{col} for manually defining line, point, and ribbon colours. \item \code{ci_level} for changing the desired confidence level (default = 0.95). Note that multiple levels are allowed, e.g. \code{ci_level = c(0.8, 0.95)}.