add sample means example
This commit is contained in:
parent
564a430868
commit
64791f0762
11
demos/sample_means/generate_plots.R
Normal file
11
demos/sample_means/generate_plots.R
Normal 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()
|
9
demos/sample_means/slurm_submit_generate_plots.sh
Normal file
9
demos/sample_means/slurm_submit_generate_plots.sh
Normal 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"
|
Loading…
Reference in New Issue
Block a user