Skip to content

Instantly share code, notes, and snippets.

View jefferys's full-sized avatar

Stuart R. Jefferys jefferys

  • UNC Chapel Hill
View GitHub Profile
@jefferys
jefferys / ensurePackages.R
Last active February 18, 2021 23:46
Check for needed R packages, optionally installing them.
hasPackage <- function( package ) {
suppressWarnings( suppressMessages(
require( package, quietly= TRUE, warn.conflicts= FALSE, character.only= TRUE )
))
}
# Set progress=FALSE to hide progress messages. Install messages always
# displayed as they are changing the system.
ensurePackages <- function( packages, installOk= FALSE, progress= TRUE,
exitOnError= installOk ) {
@jefferys
jefferys / micromambaSetup.sbatch
Created January 8, 2024 19:52
Micromamba local self-contained environment setup using Slurm if avaialble
#!/usr/bin/env bash
#SBATCH --job-name mambaEnv
#SBATCH --cpus-per-task 6
#SBATCH --mem 16G
#SBATCH --partition allnodes
#SBATCH --output ./mambaEnv.%j.out
#SBATCH --error ./mambaEnv.%j.err
# yaml filename is required argument 1