# pressure.R # compute the pressure from the file sigma.dat # use from unix shell: Rscript pressure.R s<-read.table("sigma.dat",header=TRUE) # compute the pressure p = (sigma_xx+sigma_yy+sigma_zz)/3 p<-rowMeans(s[,1:3]) summary(p)