1#!/usr/bin/Rscript 2# 3# Common utility library for all R scripts. 4 5# Log message with timing. Example: 6# 7# _____ 1.301 My message 8# 9# The prefix makes it stand out (vs R's print()), and the number is the time so 10# far. 11# 12# NOTE: The shell script log uses hyphens. 13 14Log <- function(...) { 15 cat(sprintf('_____ %.3f ', proc.time()[['elapsed']])) 16 cat(sprintf(...)) 17 cat('\n') 18} 19