:78 Function create_function() is deprecated [8192]

adding utility file containing a plotting function to visualize convergence of MC calculation

Marcelo Ponce [2018-10-18 01:39:37]
adding utility file containing a plotting function to visualize convergence of MC calculation
Filename
plottingTools.R
diff --git a/plottingTools.R b/plottingTools.R
new file mode 100644
index 0000000..02603b0
--- /dev/null
+++ b/plottingTools.R
@@ -0,0 +1,17 @@
+# MSC1090, Fall 2018 - UofT/SciNet %%% Marcelo Ponce
+# this script is used to visually explore the results of your
+# assignment #5
+
+# this function receives as arguments two vectors
+# containing the sample sizes and probabilities values
+
+# function to generate a semi-log plot of two vectors with connecting lines
+plotMC <- function(NS,probs) {
+	# check that the arguments have matching dimensions
+	if (length(NS)!=length(probs)) {
+		stop("The function requires two vectors with the same number of eleemnts!")
+	}
+
+	# semi-log plot of probs vs NS with connecting lines
+	plot(log(NS),probs,'b')
+}
ViewGit