User Tools

Site Tools


it:r

R snippets

executable boxplot script

executable file boxplot.R:

#!/usr/bin/Rscript
 
argu <- commandArgs(trailingOnly = TRUE)
data <- read.csv(file("stdin"), sep=";")
pdf(argu[2], width=12, height=9)
formu <- argu[1]
boxplot(as.formula(formu), data=data)
dev.off()
title(argu[3])

example usage:

./boxplot.R "log10(time) ~ task" out.pdf < ../path/Mappe1.csv
evince out.pdf
 
grep -v "generate" ../path/Mappe1.csv | boxplot.R "log10(time) ~ task" out.pdf
 
grep -e "task;" -e "add;" tree-benchmark.csv | boxplot.R "memory/1024 ~ class+task" out.pdf "memory (MB)"
it/r.txt · Last modified: 2013/03/23 10:18 by Alexander Rind

alex @ ieg: home about me publications research