R

Published

May 13, 2025

Modified

May 13, 2025

Running R

  • Running an R script via the terminal and directing outputs to “out” and “error” files:
Terminal
nohup Rscript my-r-script.r > output.out 2> error.err &

Data Visualization

  • Visually inspecting a color palette:
R
library(scales)
pal <- rgb(ddf$r, ddf$g, ddf$b)
show_col(pal)

Statistics

  • Checking whether the design of an experiment is confounded:
R
# X is the design matrix
qr(X)$rank