diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-03-08 18:15:32 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-03-08 18:15:32 +0000 |
commit | 716b56b71b8513faa617acb38e2a841b59910b44 (patch) | |
tree | e39ff38dafe468501f097e7a07646633453b09b9 /reproduce/analysis/make | |
parent | c66f973ff865d0cdec38f940430221addb32c76f (diff) |
Menke+20 example: properly count number of papers with software
Until now, I was mistakenly multiplying the fraction of papers in that
journal. This is corrected with this commit.
Diffstat (limited to 'reproduce/analysis/make')
-rw-r--r-- | reproduce/analysis/make/analysis-1.mk | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/reproduce/analysis/make/analysis-1.mk b/reproduce/analysis/make/analysis-1.mk index 9d0018e..f739306 100644 --- a/reproduce/analysis/make/analysis-1.mk +++ b/reproduce/analysis/make/analysis-1.mk @@ -47,9 +47,10 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir) # count as a delimter. 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 - 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)}' \ + echo "# Column 3: NUM_PAPERS_WITH_TOOLS [counter, i16] Number of papers with an identified tool." >> $@.tmp + echo "# Column 4: NUM_ID_TOOLS [counter, i16] Number of software/tools that were identified." >> $@.tmp + echo "# Column 5: JOURNAL_NAME [string, str150] Name of journal." >> $@.tmp + awk 'NR>1{printf("%-10d%-10d%-10d%-10d %s\n", $$2, $$3, $$3*$$NF, $$(NF-1), $$1)}' \ FPAT='([^,]+)|("[^"]+")' $(indir)/$$base.csv >> $@.tmp # Set the temporary file as the final target. This was done so if @@ -60,6 +61,16 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir) +############################ +# Recreate Figure 1C of Menke+20. +############################ + +# awk '!/^#/{all[$1]+=$2; id[$1]+=$3} END{for(year in all){print year, id[year]/all[year]}}' menke20-table-3.txt.tmp +############################ + + + + # Main LaTeX macro file $(mtexdir)/analysis-1.tex: $(mk20tab3) | $(mtexdir) @@ -73,6 +84,6 @@ $(mtexdir)/analysis-1.tex: $(mk20tab3) | $(mtexdir) # 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}' \ + v=$$(awk 'BEGIN{FIELDWIDTHS="41 10000"} !/^#/{print $$2}' \ $(mk20tab3) | uniq | wc -l) echo "\newcommand{\menkenumjournals}{$$v}" >> $@ |