From f51082b27e47e552658000689161c150d9c9a70e Mon Sep 17 00:00:00 2001
From: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Date: Sun, 16 Feb 2020 04:03:20 +0000
Subject: Two values from the input dataset are now written into the paper

This was done just to get going with describing the analysis process.
---
 reproduce/analysis/make/menke2020.mk | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

(limited to 'reproduce/analysis')

diff --git a/reproduce/analysis/make/menke2020.mk b/reproduce/analysis/make/menke2020.mk
index df87080..4dd9897 100644
--- a/reproduce/analysis/make/menke2020.mk
+++ b/reproduce/analysis/make/menke2020.mk
@@ -48,7 +48,8 @@ $(mk20tab3): $(indir)/menke-etal-2020.xlsx | $(mk20dir)
 	echo "# Column 1: YEAR [counter, i16] Year of journal's publication." > $@.tmp
 	echo "# Column 2: NUM_PAPERS [counter, i16] Number of studied papers in that journal." >> $@.tmp
 	echo "# Column 3: NUM_ID_TOOLS [counter, i16] Number of software/tools that were identified." >> $@.tmp
-	awk 'NR>1{printf("%-6d%-5d%d\n", $$2, $$3, $$(NF-1)*$$NF)}' \
+	echo "# Column 4: JOURNAL_NAME [string, str150] Name of journal." >> $@.tmp
+	awk 'NR>1{printf("%-10d%-10d%-10d %s\n", $$2, $$3, $$(NF-1)*$$NF, $$1)}' \
 	    FPAT='([^,]+)|("[^"]+")' $(indir)/$$base.csv >> $@.tmp
 
         # Set the temporary file as the final target. This was done so if
@@ -62,4 +63,16 @@ $(mk20tab3): $(indir)/menke-etal-2020.xlsx | $(mk20dir)
 
 # Main LaTeX macro file
 $(mtexdir)/menke2020.tex: $(mk20tab3) | $(mtexdir)
-	touch $@
+
+        # Count the total number of papers in their study.
+	v=$$(awk '!/^#/{c+=$$2} END{print c}' $(mk20tab3))
+	echo "\newcommand{\menkenumpapers}{$$v}" > $@
+
+        # Count how many unique journals there were in the study. Note that
+        # the `31' comes because we put 10 characters for each numeric
+        # column and separated the last numeric column from the string
+        # column with a space. If the number of numeric columns change in
+        # the future, the `31' also has to change.
+	v=$$(awk 'BEGIN{FIELDWIDTHS="31 10000"} !/^#/{print $$2}' \
+	         $(mk20tab3) | uniq | wc -l)
+	echo "\newcommand{\menkenumjournals}{$$v}" >> $@
-- 
cgit v1.2.1