#!/usr/bin/R #cat("-- reading arguments\n", sep = ""); cmd_args = commandArgs(); #print(cmd_args); #for (arg in cmd_args) cat(" ", arg, "\n", sep=""); cat("\n") # attempting the data filename is the last argument filename<-cmd_args[length(cmd_args)] #cat(filename, "\n") data <- read.table(filename) d <- data$V1[data$V2=="first"] cat("\n") cat("", length(d), "\n", sep="") cat("", 100 * summary(d)[4], "\n", sep="") cat("", 100 * sqrt(var(d)), "\n", sep="") cat("\n") d <- data$V1[data$V2=="second"] cat("\n") cat("", length(d), "\n", sep="") cat("", 100 * summary(d)[4], "\n", sep="") cat("", 100 * sqrt(var(d)), "\n", sep="") cat("\n") #boxplot(d$V1 ~ d$V2) #t.test(d$V1 ~ d$V2) #oneway.test(d$V1 ~ d$V2, var.equal=FALSE) #oneway.test(d$V1 ~ d$V2, var.equal=TRUE) s <- summary(lm(data))$fstatistic pvalue <- pf(s[1], s[2], s[3], lower.tail=F) cat("", pvalue, "\n", sep="") cat("\n")