Skip to content

Instantly share code, notes, and snippets.

View Matherion's full-sized avatar

Gjalt-Jorn Peters Matherion

View GitHub Profile
@artemklevtsov
artemklevtsov / .gitlab-ci.yml
Last active January 12, 2024 04:14
Testing R package with GitLab CI (with code coverage)
variables:
CODECOV_TOKEN: "CODECOV_TOKEN_STRING"
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
APT_PKGS: "libcurl4-openssl-dev libssh2-1-dev libssl-dev libxml2-dev zlib1g-dev git"
before_script:
- apt-get update
- apt-get install -y --no-install-recommends ${APT_PKGS}
- apt-get install -y --no-install-recommends qpdf pandoc pandoc-citeproc
@rentrop
rentrop / gg_qq.r
Last active December 3, 2023 06:01
This function plots a QQplot as ggplot in R - Parts of the code copied from `car:::qqPlot`
gg_qq <- function(x, distribution = "norm", ..., line.estimate = NULL, conf = 0.95,
labels = names(x)){
q.function <- eval(parse(text = paste0("q", distribution)))
d.function <- eval(parse(text = paste0("d", distribution)))
x <- na.omit(x)
ord <- order(x)
n <- length(x)
P <- ppoints(length(x))
df <- data.frame(ord.x = x[ord], z = q.function(P, ...))