You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

11 lines
338 B

#! /usr/bin/env Rscript
gm_mean = function(x, na.rm=TRUE){
exp(sum(log(x[x > 0]), na.rm=na.rm) / length(x))
}
d<-scan("stdin", quiet=TRUE)
cat(sprintf("%12s %12.3f\n", "min", min(d)))
cat(sprintf("%12s %12.3f\n", "max", max(d)))
cat(sprintf("%12s %12.3f\n", "median", median(d)))
cat(sprintf("%12s %12.3f\n", "geom mean", gm_mean(d)))