fitness=read.table("fitnessdata.txt",header=T,sep="") attach(fitness) # the paired t-test uses the same command with different options # as usual, the default is a 2-tailed test t.test(after,before,paired=T) # or you can calculate the differences and then do a 1 sample t-test d=after-before t.test(d,mu=0)