R/dotplot2.R

#' dotplot2
#' 
#' Utilisation de dotplot1, puis ajout :
#' - identification des outliers
#' - "RLS hors limites de référence"
#' - "CVS de référence : 'cvs'"
#'
#' @param x,limref,cvs,cvslabel,max.ratio Voir .dotplot1()
#'
#' @import ggplot2
#' @keywords internal
#' @export
dotplot2 <- function(x, limref, cvs, cvslabel = max(cvs), max.ratio){
  p <- dotplot1(x, limref, cvs, cvslabel, max.ratio)
  p <- p + 
    geom_text(aes(xcoord, ycoord, label = dotnum), hjust = 1, size = 2) +  # affichage des regions
    geom_text(aes(max(limref$valeur)+0.1, -ycoord),  # indiquer les CVS de référence
              label = TeX(paste0("$CVS_{réf}$ = ",paste(sort(cvs, decreasing = T), collapse = ", "))),
              size = 2.5,
              hjust = 0) +
    geom_text(aes(max(xcoord)+.2, ycoord),  # legende : RLS hors limites
              label = "RLS hors limites\nde référence",
              size = 2.5,
              hjust = 1)
  return(p)
}
INESSSQC/variation documentation built on July 3, 2019, 11:33 a.m.