Skip to content

Instantly share code, notes, and snippets.

@igroff
Last active August 29, 2015 14:03
Show Gist options
  • Save igroff/ded9637d6a01ab8fa747 to your computer and use it in GitHub Desktop.
Save igroff/ded9637d6a01ab8fa747 to your computer and use it in GitHub Desktop.
Rscript to calculate 'stats' from a list of numbers on stdin
#! /usr/bin/env Rscript
a <- scan(file("stdin"), c(0), quiet=TRUE);
cat(length(a), sd(a), min(a), max(a), mean(a), median(a), "\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment