add sample means example

This commit is contained in:
Garrett Mills 2019-05-01 15:20:03 -05:00
parent 564a430868
commit 64791f0762
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,11 @@
arg = commandArgs(TRUE)
samples = rep(NA, 100000)
for ( i in 1:100000 ){ samples[i] = mean(rexp(40, 0.2)) }
jpeg(paste('plots/', arg, '.jpg', sep=""))
hist(samples, main="", prob=T)
lines(density(samples), col="darkblue", lwd=3)
dev.off()

View File

@ -0,0 +1,9 @@
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
cd $SLURM_SUBMIT_DIR
mkdir plots/
R --vanilla -f generate.R --args "plot$SLURM_ARRAY_TASK_ID"