Lab moderna: add p4
Change-Id: I56673d05625f628fbb33acfad3b482e3158cbb42
diff --git a/quad12/labmoderna/p4a/r/main.r b/quad12/labmoderna/p4a/r/main.r
new file mode 100644
index 0000000..41f7560
--- /dev/null
+++ b/quad12/labmoderna/p4a/r/main.r
@@ -0,0 +1,10 @@
+table <- read.table('dades/dades.txt', sep="\t", dec='.', header=TRUE)
+table$LogIntensitatReal <- log(table$IntensitatReal)
+
+fit <- lm(LogIntensitatReal~GruixMassic, data = table)
+summary(fit)
+
+svg(file='output/p1a.svg', width=6, height=5)
+plot(table$GruixMassic, table$LogIntensitatReal, xlab="Gruix màssic (mg/cm^2)", ylab="log(Intensitat · s)")
+abline(fit, col = "mediumorchid2")
+dev.off()