R/addEllipseInfo.R

Defines functions .addEllipseInfo

Documented in .addEllipseInfo

#'
#' Add Info About Ellipses to Plot
#'
#' *Internal* function.
#'
#' @param ellipse String giving the type of ellipse; one of `cls`, `rob` or `both`.
#' @return None. Side effect is a modified plot.
#'
#' @author `r .writeDoc_Authors("BH")`
#' @export
#' @importFrom graphics legend
#' @keywords internal
#'

.addEllipseInfo <- function(ellipse) {
  if (ellipse == "cls") {
    legend("topleft",
      y = NULL, "classic ellipses by group", lty = 3, bty = "n",
      col = "black", cex = 0.75, inset = c(0, 0.03)
    )
  }

  if (ellipse == "rob") {
    legend("topleft",
      y = NULL, "robust ellipses by group", lty = 1, bty = "n",
      col = "black", cex = 0.75, inset = c(0, 0.03)
    )
  }

  if (ellipse == "both") {
    legend("topleft",
      y = NULL, "classic ellipses by group", lty = 3, bty = "n",
      col = "black", cex = 0.75, inset = c(0, 0.03)
    )
    legend("topleft",
      y = NULL, "robust ellipses by group", lty = 1, bty = "n",
      col = "black", inset = c(0.0, 0.06), cex = 0.75
    )
  }
}

Try the ChemoSpecUtils package in your browser

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

ChemoSpecUtils documentation built on May 31, 2023, 5:56 p.m.