R/JOPS_theme.R

Defines functions JOPS_theme

Documented in JOPS_theme

#' Custom theming function used to unify ggplot features
#'
#' @description Set a ggplot theme in black and white, with centered titles.
#' @param h_just horizontal justification for ggplot2.
#' @return Custom theming function used to unify ggplot features.
#'
#' @references Eilers, P.H.C. and Marx, B.D. (2021). \emph{Practical Smoothing, The Joys of
#' P-splines.} Cambridge University Press.
#'
#' @export
#' @import ggplot2
JOPS_theme = function(h_just = 0.5) {
  ggplot2::theme_bw() + ggplot2::theme(plot.title = ggplot2::element_text(hjust = h_just))
}

Try the JOPS package in your browser

Any scripts or data that you put into this service are public.

JOPS documentation built on Sept. 8, 2023, 5:42 p.m.