From 7c05303cda6dfdaf4a25906a4f83ec659a30d158 Mon Sep 17 00:00:00 2001 From: glmdev Date: Thu, 2 May 2019 19:04:58 -0500 Subject: [PATCH] update sample means demo --- demos/sample_means/generate_plots.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/sample_means/generate_plots.R b/demos/sample_means/generate_plots.R index e4f108c..1f305ea 100644 --- a/demos/sample_means/generate_plots.R +++ b/demos/sample_means/generate_plots.R @@ -2,7 +2,7 @@ if ( !is.loaded("mpi_initialize") ){ library(Rmpi) } -number_of_plots = 5 +number_of_plots = 10 nodes = mpi.universe.size()-1 mpi.spawn.Rslaves(nslaves=nodes) @@ -11,7 +11,7 @@ generate_plot <- function(filename){ samples = rep(NA, 100000) for ( i in 1:100000 ){ samples[i] = mean(rexp(40, 0.2)) } - jpeg(paste('plots/', filename, '.jpg', sep="")) + jpeg(paste('plots/plot', filename, '.jpg', sep="")) hist(samples, main="", prob=T) lines(density(samples), col="darkblue", lwd=3)