split sample means
This commit is contained in:
parent
a12a45404a
commit
b4d6130575
BIN
demos/sample_means/plots/bob.jpg
Normal file
BIN
demos/sample_means/plots/bob.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
11
demos/sample_means/slurm_generate_plots.R
Normal file
11
demos/sample_means/slurm_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()
|
@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#SBATCH --ntasks=5
|
#SBATCH --ntasks=6
|
||||||
|
|
||||||
cd $SLURM_SUBMIT_DIR
|
cd $SLURM_SUBMIT_DIR
|
||||||
|
|
||||||
mkdir plots/
|
mkdir plots/
|
||||||
|
|
||||||
mpiexec -n 1 R --vanilla -f generate_plots.R
|
R --vanilla -f slurm_generate_plots.R --args "plot$SLURM_ARRAY_TASK_ID"
|
||||||
|
Loading…
Reference in New Issue
Block a user