Lab moderna: add P1

Change-Id: Ibbbfa656bfcd29eef2afb9dbd78488e4484054b6
diff --git a/quad12/labmoderna/p1a/r/main.r b/quad12/labmoderna/p1a/r/main.r
new file mode 100644
index 0000000..151853a
--- /dev/null
+++ b/quad12/labmoderna/p1a/r/main.r
@@ -0,0 +1,14 @@
+library(tikzDevice)
+
+table <- read.table('../dades/fons_a.txt', sep="\t", dec=',', header=TRUE)
+m = mean(table$ImpulsesPerSecond)
+m
+unc = sd(table$ImpulsesPerSecond)
+unc
+
+tikz("fons_fluctuacio.tex", width = 5, height = 4)
+plot(table$t, table$ImpulsesPerSecond, pch = 4, xlab = "$t$ (s)", ylim = c(-2.1, 2.1), ylab = "$I$ (\\#/s)")
+abline(h = m + unc, col = "red", lty = 2)
+abline(h = m - unc, col = "red", lty = 2)
+abline(h = m, col = "green", lty = 2)
+dev.off()