{
  "schemaVersion": 1,
  "apiVersion": "DATA07-records-v1",
  "scope": "Fixed archived actual Python/R processes and SVG artifacts; no browser language execution.",
  "runtime": {
    "pythonExecutable": "[runtime-path:285b9645b5]/python.exe",
    "python": "Python 3.11.8",
    "matplotlib": "3.10.0",
    "rExecutable": "[runtime-path:c0d1141810]/Rscript.exe",
    "r": "Rscript (R) version 4.5.1 (2025-06-13)",
    "pythonExecutionPolicy": {
      "backend": "Agg",
      "svgFontType": "none",
      "fontFamily": "DejaVu Sans",
      "svgHashSalt": "DATA07-fixed-plot",
      "figureSizeInches": [
        8,
        4.6
      ],
      "svgDateMetadata": null,
      "sourceLocalSettings": true
    },
    "rExecutionPolicy": {
      "commandFlags": [
        "--vanilla"
      ],
      "characterLocaleRequestOnWindows": "English_United States.utf8",
      "numericJSONFormat": "format digits=17,scientific=FALSE",
      "recorderOverridesDisplayOptions": false,
      "graphics": "base R svg",
      "figureSizeInches": [
        8,
        4.6
      ],
      "sourceLocalSettings": true
    }
  },
  "audit": {
    "python": {
      "toy": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 4, \"availableCount\": 3, \"missingCount\": 1, \"observedZeroCount\": 1, \"availableSum\": 6, \"availableMean\": 2.0, \"availableMedian\": 2, \"rawValues\": [0, 2, null, 4], \"zeroFillWasPerformed\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "toy",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nvalues=[0,2,None,4]\navailable=[x for x in values if x is not None]\nprint(json.dumps(dict(sourceCount=len(values),availableCount=len(available),missingCount=len(values)-len(available),observedZeroCount=available.count(0),availableSum=sum(available),availableMean=sum(available)/len(available),availableMedian=sorted(available)[len(available)//2],rawValues=values,zeroFillWasPerformed=False)))\n",
        "codeFile": "data07-snippets/python/audit-toy.py",
        "codeSha256": "f5de545b345e08cad052ce7680543bf82a76dcdc5a8cd760751c765d5fa94958",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 4,
          "availableCount": 3,
          "missingCount": 1,
          "observedZeroCount": 1,
          "availableSum": 6,
          "availableMean": 2.0,
          "availableMedian": 2,
          "rawValues": [
            0,
            2,
            null,
            4
          ],
          "zeroFillWasPerformed": false
        },
        "plotFile": null,
        "plotSha256": null,
        "plotGeneratedBy": null,
        "example": "toy",
        "toyData": true
      },
      "person": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3613, \"rawAvailable\": 3017, \"rawMissing\": 596, \"logAvailable\": 3010, \"logMissing\": 603, \"rawAvailableLogMissing\": 7, \"rawSumCents\": 1738060, \"rawMeanUSD\": 5.7608882996354, \"rawMeanUSDExact\": \"86903/15085\", \"rawMedianUSD\": 5.35, \"rawMinUSD\": 0.25, \"rawMaxUSD\": 24.04, \"rawObservedZeroCount\": 0, \"zeroFillWasPerformed\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "person",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nrows=load_csv(sys.argv[1])\nraw=[int(r[\"raw_hourly_wage1976_cents_source_decimal\"]) for r in rows if r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\"]\nlogs=[r[\"source_trimmed_log1976_cents_source_decimal\"] for r in rows if r[\"source_trimmed_log1976_cents_source_decimal\"]!=\"\"]\nmean=Fraction(sum(raw),100*len(raw));median=Fraction(sorted(raw)[len(raw)//2],100)\nprint(json.dumps(dict(sourceCount=len(rows),rawAvailable=len(raw),rawMissing=len(rows)-len(raw),logAvailable=len(logs),logMissing=len(rows)-len(logs),rawAvailableLogMissing=sum(r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\" and r[\"source_trimmed_log1976_cents_source_decimal\"]==\"\" for r in rows),rawSumCents=sum(raw),rawMeanUSD=float(mean),rawMeanUSDExact=str(mean),rawMedianUSD=float(median),rawMinUSD=min(raw)/100,rawMaxUSD=max(raw)/100,rawObservedZeroCount=raw.count(0),zeroFillWasPerformed=False)))\n",
        "codeFile": "data07-snippets/python/audit-person.py",
        "codeSha256": "8c77223f7d7d23fc29655ac54551c9c3910e7b2cf254db7141b1e2fdad5800a9",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "rawAvailable": 3017,
          "rawMissing": 596,
          "logAvailable": 3010,
          "logMissing": 603,
          "rawAvailableLogMissing": 7,
          "rawSumCents": 1738060,
          "rawMeanUSD": 5.7608882996354,
          "rawMeanUSDExact": "86903/15085",
          "rawMedianUSD": 5.35,
          "rawMinUSD": 0.25,
          "rawMaxUSD": 24.04,
          "rawObservedZeroCount": 0,
          "zeroFillWasPerformed": false
        },
        "plotFile": null,
        "plotSha256": null,
        "plotGeneratedBy": null,
        "example": "person",
        "toyData": false
      }
    },
    "r": {
      "toy": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":4,\"availableCount\":3,\"missingCount\":1,\"observedZeroCount\":1,\"availableSum\":6,\"availableMean\":2,\"availableMedian\":2,\"rawValues\":[0,2,null,4],\"zeroFillWasPerformed\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "toy",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nvalues <- c(0,2,NA_real_,4)\navailable <- values[!is.na(values)]\nemit(list(sourceCount=length(values),availableCount=length(available),missingCount=sum(is.na(values)),observedZeroCount=sum(available==0),availableSum=sum(available),availableMean=mean(available),availableMedian=median(available),rawValues=as.list(values),zeroFillWasPerformed=FALSE))\n",
        "codeFile": "data07-snippets/r/audit-toy.R",
        "codeSha256": "6ec1e16e71c8002dc6199d3dbb0ad62768d745ee1174bdd5175e70f6eac35cf2",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 4,
          "availableCount": 3,
          "missingCount": 1,
          "observedZeroCount": 1,
          "availableSum": 6,
          "availableMean": 2,
          "availableMedian": 2,
          "rawValues": [
            0,
            2,
            null,
            4
          ],
          "zeroFillWasPerformed": false
        },
        "plotFile": null,
        "plotSha256": null,
        "plotGeneratedBy": null,
        "example": "toy",
        "toyData": true
      },
      "person": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3613,\"rawAvailable\":3017,\"rawMissing\":596,\"logAvailable\":3010,\"logMissing\":603,\"rawAvailableLogMissing\":7,\"rawSumCents\":1738060,\"rawMeanUSD\":5.7608882996353996,\"rawMedianUSD\":5.3499999999999996,\"rawMinUSD\":0.25,\"rawMaxUSD\":24.039999999999999,\"rawObservedZeroCount\":0,\"zeroFillWasPerformed\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "person",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nrows <- load_csv(args[1])\nraw <- as.numeric(rows$raw_hourly_wage1976_cents_source_decimal[rows$raw_hourly_wage1976_cents_source_decimal!=\"\"])\nlogs <- rows$source_trimmed_log1976_cents_source_decimal[rows$source_trimmed_log1976_cents_source_decimal!=\"\"]\nemit(list(sourceCount=nrow(rows),rawAvailable=length(raw),rawMissing=nrow(rows)-length(raw),logAvailable=length(logs),logMissing=nrow(rows)-length(logs),rawAvailableLogMissing=sum(rows$raw_hourly_wage1976_cents_source_decimal!=\"\" & rows$source_trimmed_log1976_cents_source_decimal==\"\"),rawSumCents=sum(raw),rawMeanUSD=mean(raw)/100,rawMedianUSD=median(raw)/100,rawMinUSD=min(raw)/100,rawMaxUSD=max(raw)/100,rawObservedZeroCount=sum(raw==0),zeroFillWasPerformed=FALSE))\n",
        "codeFile": "data07-snippets/r/audit-person.R",
        "codeSha256": "ff60b02c7edd2032ada4f8ea71f91ef323c75149262c1f4594e094355d91321b",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "rawAvailable": 3017,
          "rawMissing": 596,
          "logAvailable": 3010,
          "logMissing": 603,
          "rawAvailableLogMissing": 7,
          "rawSumCents": 1738060,
          "rawMeanUSD": 5.7608882996354,
          "rawMedianUSD": 5.35,
          "rawMinUSD": 0.25,
          "rawMaxUSD": 24.04,
          "rawObservedZeroCount": 0,
          "zeroFillWasPerformed": false
        },
        "plotFile": null,
        "plotSha256": null,
        "plotGeneratedBy": null,
        "example": "person",
        "toyData": false
      }
    }
  },
  "histogram": {
    "python": {
      "unequal-usd": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3613, \"availableCount\": 3017, \"missingCount\": 596, \"edges\": [0, 2, 4, 8, 16, 25], \"counts\": [48, 723, 1759, 467, 20], \"widths\": [2, 2, 4, 8, 9], \"relativeFrequencies\": [0.015909844216108717, 0.23964202850513755, 0.5830294995028173, 0.15478952601922438, 0.006629101756711966], \"densities\": [0.007954922108054359, 0.11982101425256877, 0.14575737487570434, 0.019348690752403048, 0.000736566861856885], \"relativeFrequencyExact\": [\"48/3017\", \"723/3017\", \"1759/3017\", \"467/3017\", \"20/3017\"], \"densityExact\": [\"24/3017\", \"723/6034\", \"1759/12068\", \"467/24136\", \"20/27153\"], \"areas\": [0.015909844216108717, 0.23964202850513755, 0.5830294995028173, 0.15478952601922438, 0.006629101756711966], \"densityArea\": 1.0, \"insideCount\": 3017, \"outsideCount\": 0, \"leftClosed\": true, \"lastRightClosed\": true, \"binChoiceChangesObservations\": false, \"unit\": \"usd\"}\n",
        "stderr": "",
        "language": "python",
        "id": "unequal-usd",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nraw=[int(r[\"raw_hourly_wage1976_cents_source_decimal\"]) for r in rows if r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\"]\ncents_edges=[0, 200, 400, 800, 1600, 2500];edges=[0, 2, 4, 8, 16, 25]\ncounts=[sum(a<=v<b or (i==len(cents_edges)-2 and v==b) for v in raw) for i,(a,b) in enumerate(zip(cents_edges,cents_edges[1:]))]\nwidths=[b-a for a,b in zip(edges,edges[1:])]\nrelative=[Fraction(c,len(raw)) for c in counts]\ndensity=[p/w for p,w in zip(relative,widths)]\nax.bar(edges[:-1],[float(v) for v in density],width=widths,align=\"edge\",edgecolor=\"black\",color=\"#347c93\")\nax.set(xlim=(edges[0],edges[-1]),ylim=(0,max(map(float,density))*1.18),xlabel='1976 USD/hour',ylabel=\"Relative frequency / bin width\",title='Actual raw wages: unequal bins')\nax.set_xticks(edges)\nfor a,w,h,c in zip(edges,widths,density,counts):ax.text(a+w/2,float(h),str(c),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),availableCount=len(raw),missingCount=len(rows)-len(raw),edges=edges,counts=counts,widths=widths,relativeFrequencies=list(map(float,relative)),densities=list(map(float,density)),relativeFrequencyExact=list(map(str,relative)),densityExact=list(map(str,density)),areas=list(map(float,relative)),densityArea=float(sum(relative)),insideCount=sum(counts),outsideCount=len(raw)-sum(counts),leftClosed=True,lastRightClosed=True,binChoiceChangesObservations=False,unit='usd')))\n",
        "codeFile": "data07-snippets/python/histogram-unequal-usd.py",
        "codeSha256": "866080ead0614d158616d01fc1458500c69680b6b25fb06a760b62b8659afffc",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-unequal-usd-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            2,
            4,
            8,
            16,
            25
          ],
          "counts": [
            48,
            723,
            1759,
            467,
            20
          ],
          "widths": [
            2,
            2,
            4,
            8,
            9
          ],
          "relativeFrequencies": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densities": [
            0.007954922108054359,
            0.11982101425256877,
            0.14575737487570434,
            0.019348690752403048,
            0.000736566861856885
          ],
          "relativeFrequencyExact": [
            "48/3017",
            "723/3017",
            "1759/3017",
            "467/3017",
            "20/3017"
          ],
          "densityExact": [
            "24/3017",
            "723/6034",
            "1759/12068",
            "467/24136",
            "20/27153"
          ],
          "areas": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densityArea": 1.0,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "usd"
        },
        "plotFile": "data07-plots/histogram-unequal-usd-python.svg",
        "plotSha256": "42cc13d6701387d97b2b873bccc5ebb8ef69ecefaa71a06119f4b2b28944cb8a",
        "plotGeneratedBy": "Matplotlib",
        "bins": "unequal",
        "unit": "usd",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "unequal-cents": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3613, \"availableCount\": 3017, \"missingCount\": 596, \"edges\": [0, 200, 400, 800, 1600, 2500], \"counts\": [48, 723, 1759, 467, 20], \"widths\": [200, 200, 400, 800, 900], \"relativeFrequencies\": [0.015909844216108717, 0.23964202850513755, 0.5830294995028173, 0.15478952601922438, 0.006629101756711966], \"densities\": [7.954922108054358e-05, 0.0011982101425256878, 0.0014575737487570433, 0.0001934869075240305, 7.36566861856885e-06], \"relativeFrequencyExact\": [\"48/3017\", \"723/3017\", \"1759/3017\", \"467/3017\", \"20/3017\"], \"densityExact\": [\"6/75425\", \"723/603400\", \"1759/1206800\", \"467/2413600\", \"1/135765\"], \"areas\": [0.015909844216108717, 0.23964202850513755, 0.5830294995028173, 0.15478952601922438, 0.006629101756711966], \"densityArea\": 1.0, \"insideCount\": 3017, \"outsideCount\": 0, \"leftClosed\": true, \"lastRightClosed\": true, \"binChoiceChangesObservations\": false, \"unit\": \"cents\"}\n",
        "stderr": "",
        "language": "python",
        "id": "unequal-cents",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nraw=[int(r[\"raw_hourly_wage1976_cents_source_decimal\"]) for r in rows if r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\"]\ncents_edges=[0, 200, 400, 800, 1600, 2500];edges=[0, 200, 400, 800, 1600, 2500]\ncounts=[sum(a<=v<b or (i==len(cents_edges)-2 and v==b) for v in raw) for i,(a,b) in enumerate(zip(cents_edges,cents_edges[1:]))]\nwidths=[b-a for a,b in zip(edges,edges[1:])]\nrelative=[Fraction(c,len(raw)) for c in counts]\ndensity=[p/w for p,w in zip(relative,widths)]\nax.bar(edges[:-1],[float(v) for v in density],width=widths,align=\"edge\",edgecolor=\"black\",color=\"#347c93\")\nax.set(xlim=(edges[0],edges[-1]),ylim=(0,max(map(float,density))*1.18),xlabel='1976 cents/hour',ylabel=\"Relative frequency / bin width\",title='Actual raw wages: unequal bins')\nax.set_xticks(edges)\nfor a,w,h,c in zip(edges,widths,density,counts):ax.text(a+w/2,float(h),str(c),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),availableCount=len(raw),missingCount=len(rows)-len(raw),edges=edges,counts=counts,widths=widths,relativeFrequencies=list(map(float,relative)),densities=list(map(float,density)),relativeFrequencyExact=list(map(str,relative)),densityExact=list(map(str,density)),areas=list(map(float,relative)),densityArea=float(sum(relative)),insideCount=sum(counts),outsideCount=len(raw)-sum(counts),leftClosed=True,lastRightClosed=True,binChoiceChangesObservations=False,unit='cents')))\n",
        "codeFile": "data07-snippets/python/histogram-unequal-cents.py",
        "codeSha256": "187183b54ad4d55f013bf37e73d8b583a0854b628db674e31efcc76dc15d2151",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-unequal-cents-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            200,
            400,
            800,
            1600,
            2500
          ],
          "counts": [
            48,
            723,
            1759,
            467,
            20
          ],
          "widths": [
            200,
            200,
            400,
            800,
            900
          ],
          "relativeFrequencies": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densities": [
            7.954922108054358e-05,
            0.0011982101425256878,
            0.0014575737487570433,
            0.0001934869075240305,
            7.36566861856885e-06
          ],
          "relativeFrequencyExact": [
            "48/3017",
            "723/3017",
            "1759/3017",
            "467/3017",
            "20/3017"
          ],
          "densityExact": [
            "6/75425",
            "723/603400",
            "1759/1206800",
            "467/2413600",
            "1/135765"
          ],
          "areas": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densityArea": 1.0,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "cents"
        },
        "plotFile": "data07-plots/histogram-unequal-cents-python.svg",
        "plotSha256": "2e44a14473b9bd91e1454dfb27d188f88561eda79957dd34a55f3e8e5ff21161",
        "plotGeneratedBy": "Matplotlib",
        "bins": "unequal",
        "unit": "cents",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "equal-usd": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3613, \"availableCount\": 3017, \"missingCount\": 596, \"edges\": [0, 5, 10, 15, 20, 25], \"counts\": [1284, 1540, 169, 19, 5], \"widths\": [5, 5, 5, 5, 5], \"relativeFrequencies\": [0.4255883327809082, 0.5104408352668214, 0.05601590984421611, 0.006297646668876367, 0.0016572754391779914], \"densities\": [0.08511766655618164, 0.10208816705336426, 0.011203181968843222, 0.0012595293337752734, 0.00033145508783559825], \"relativeFrequencyExact\": [\"1284/3017\", \"220/431\", \"169/3017\", \"19/3017\", \"5/3017\"], \"densityExact\": [\"1284/15085\", \"44/431\", \"169/15085\", \"19/15085\", \"1/3017\"], \"areas\": [0.4255883327809082, 0.5104408352668214, 0.05601590984421611, 0.006297646668876367, 0.0016572754391779914], \"densityArea\": 1.0, \"insideCount\": 3017, \"outsideCount\": 0, \"leftClosed\": true, \"lastRightClosed\": true, \"binChoiceChangesObservations\": false, \"unit\": \"usd\"}\n",
        "stderr": "",
        "language": "python",
        "id": "equal-usd",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nraw=[int(r[\"raw_hourly_wage1976_cents_source_decimal\"]) for r in rows if r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\"]\ncents_edges=[0, 500, 1000, 1500, 2000, 2500];edges=[0, 5, 10, 15, 20, 25]\ncounts=[sum(a<=v<b or (i==len(cents_edges)-2 and v==b) for v in raw) for i,(a,b) in enumerate(zip(cents_edges,cents_edges[1:]))]\nwidths=[b-a for a,b in zip(edges,edges[1:])]\nrelative=[Fraction(c,len(raw)) for c in counts]\ndensity=[p/w for p,w in zip(relative,widths)]\nax.bar(edges[:-1],[float(v) for v in density],width=widths,align=\"edge\",edgecolor=\"black\",color=\"#347c93\")\nax.set(xlim=(edges[0],edges[-1]),ylim=(0,max(map(float,density))*1.18),xlabel='1976 USD/hour',ylabel=\"Relative frequency / bin width\",title='Actual raw wages: equal bins')\nax.set_xticks(edges)\nfor a,w,h,c in zip(edges,widths,density,counts):ax.text(a+w/2,float(h),str(c),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),availableCount=len(raw),missingCount=len(rows)-len(raw),edges=edges,counts=counts,widths=widths,relativeFrequencies=list(map(float,relative)),densities=list(map(float,density)),relativeFrequencyExact=list(map(str,relative)),densityExact=list(map(str,density)),areas=list(map(float,relative)),densityArea=float(sum(relative)),insideCount=sum(counts),outsideCount=len(raw)-sum(counts),leftClosed=True,lastRightClosed=True,binChoiceChangesObservations=False,unit='usd')))\n",
        "codeFile": "data07-snippets/python/histogram-equal-usd.py",
        "codeSha256": "81df0002d539b4e0976d682648b6c0d630a77473efb5750a7c001b6a754aa38e",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-equal-usd-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            5,
            10,
            15,
            20,
            25
          ],
          "counts": [
            1284,
            1540,
            169,
            19,
            5
          ],
          "widths": [
            5,
            5,
            5,
            5,
            5
          ],
          "relativeFrequencies": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densities": [
            0.08511766655618164,
            0.10208816705336426,
            0.011203181968843222,
            0.0012595293337752734,
            0.00033145508783559825
          ],
          "relativeFrequencyExact": [
            "1284/3017",
            "220/431",
            "169/3017",
            "19/3017",
            "5/3017"
          ],
          "densityExact": [
            "1284/15085",
            "44/431",
            "169/15085",
            "19/15085",
            "1/3017"
          ],
          "areas": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densityArea": 1.0,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "usd"
        },
        "plotFile": "data07-plots/histogram-equal-usd-python.svg",
        "plotSha256": "ae29471217d27bc1851b5602dfee1e9743474a7c5ae801cb4e86e6bbc6e3a56c",
        "plotGeneratedBy": "Matplotlib",
        "bins": "equal",
        "unit": "usd",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "equal-cents": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3613, \"availableCount\": 3017, \"missingCount\": 596, \"edges\": [0, 500, 1000, 1500, 2000, 2500], \"counts\": [1284, 1540, 169, 19, 5], \"widths\": [500, 500, 500, 500, 500], \"relativeFrequencies\": [0.4255883327809082, 0.5104408352668214, 0.05601590984421611, 0.006297646668876367, 0.0016572754391779914], \"densities\": [0.0008511766655618164, 0.0010208816705336427, 0.00011203181968843221, 1.2595293337752735e-05, 3.314550878355983e-06], \"relativeFrequencyExact\": [\"1284/3017\", \"220/431\", \"169/3017\", \"19/3017\", \"5/3017\"], \"densityExact\": [\"321/377125\", \"11/10775\", \"169/1508500\", \"19/1508500\", \"1/301700\"], \"areas\": [0.4255883327809082, 0.5104408352668214, 0.05601590984421611, 0.006297646668876367, 0.0016572754391779914], \"densityArea\": 1.0, \"insideCount\": 3017, \"outsideCount\": 0, \"leftClosed\": true, \"lastRightClosed\": true, \"binChoiceChangesObservations\": false, \"unit\": \"cents\"}\n",
        "stderr": "",
        "language": "python",
        "id": "equal-cents",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nraw=[int(r[\"raw_hourly_wage1976_cents_source_decimal\"]) for r in rows if r[\"raw_hourly_wage1976_cents_source_decimal\"]!=\"\"]\ncents_edges=[0, 500, 1000, 1500, 2000, 2500];edges=[0, 500, 1000, 1500, 2000, 2500]\ncounts=[sum(a<=v<b or (i==len(cents_edges)-2 and v==b) for v in raw) for i,(a,b) in enumerate(zip(cents_edges,cents_edges[1:]))]\nwidths=[b-a for a,b in zip(edges,edges[1:])]\nrelative=[Fraction(c,len(raw)) for c in counts]\ndensity=[p/w for p,w in zip(relative,widths)]\nax.bar(edges[:-1],[float(v) for v in density],width=widths,align=\"edge\",edgecolor=\"black\",color=\"#347c93\")\nax.set(xlim=(edges[0],edges[-1]),ylim=(0,max(map(float,density))*1.18),xlabel='1976 cents/hour',ylabel=\"Relative frequency / bin width\",title='Actual raw wages: equal bins')\nax.set_xticks(edges)\nfor a,w,h,c in zip(edges,widths,density,counts):ax.text(a+w/2,float(h),str(c),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),availableCount=len(raw),missingCount=len(rows)-len(raw),edges=edges,counts=counts,widths=widths,relativeFrequencies=list(map(float,relative)),densities=list(map(float,density)),relativeFrequencyExact=list(map(str,relative)),densityExact=list(map(str,density)),areas=list(map(float,relative)),densityArea=float(sum(relative)),insideCount=sum(counts),outsideCount=len(raw)-sum(counts),leftClosed=True,lastRightClosed=True,binChoiceChangesObservations=False,unit='cents')))\n",
        "codeFile": "data07-snippets/python/histogram-equal-cents.py",
        "codeSha256": "ec890173ee903493c2709bdbc4101b4c11a6d723927c2c3a79ecdb629ae31fe5",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-equal-cents-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            500,
            1000,
            1500,
            2000,
            2500
          ],
          "counts": [
            1284,
            1540,
            169,
            19,
            5
          ],
          "widths": [
            500,
            500,
            500,
            500,
            500
          ],
          "relativeFrequencies": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densities": [
            0.0008511766655618164,
            0.0010208816705336427,
            0.00011203181968843221,
            1.2595293337752735e-05,
            3.314550878355983e-06
          ],
          "relativeFrequencyExact": [
            "1284/3017",
            "220/431",
            "169/3017",
            "19/3017",
            "5/3017"
          ],
          "densityExact": [
            "321/377125",
            "11/10775",
            "169/1508500",
            "19/1508500",
            "1/301700"
          ],
          "areas": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densityArea": 1.0,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "cents"
        },
        "plotFile": "data07-plots/histogram-equal-cents-python.svg",
        "plotSha256": "7516f9b2b09617fee67cd163871083925cd106ccfa3bf326ff190a40a03ef383",
        "plotGeneratedBy": "Matplotlib",
        "bins": "equal",
        "unit": "cents",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      }
    },
    "r": {
      "unequal-usd": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3613,\"availableCount\":3017,\"missingCount\":596,\"edges\":[0,2,4,8,16,25],\"counts\":[48,723,1759,467,20],\"widths\":[2,2,4,8,9],\"relativeFrequencies\":[0.015909844216108717,0.23964202850513755,0.58302949950281735,0.15478952601922438,0.0066291017567119657],\"densities\":[0.0079549221080543586,0.11982101425256877,0.14575737487570434,0.019348690752403048,0.00073656686185688503],\"areas\":[0.015909844216108717,0.23964202850513755,0.58302949950281735,0.15478952601922438,0.0066291017567119657],\"densityArea\":1,\"insideCount\":3017,\"outsideCount\":0,\"leftClosed\":true,\"lastRightClosed\":true,\"binChoiceChangesObservations\":false,\"unit\":\"usd\"}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "unequal-usd",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nraw <- as.numeric(rows$raw_hourly_wage1976_cents_source_decimal[rows$raw_hourly_wage1976_cents_source_decimal!=\"\"])\ncents_edges <- c(0,200,400,800,1600,2500)\nedges <- c(0,2,4,8,16,25)\ncounts <- vapply(seq_len(length(edges)-1),function(i) sum(raw>=cents_edges[i] & (raw<cents_edges[i+1] | (i==length(edges)-1 & raw==cents_edges[i+1]))),numeric(1))\nwidths <- diff(edges); relative <- counts/length(raw); densities <- relative/widths\nplot(NA,xlim=range(edges),ylim=c(0,max(densities)*1.18),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"1976 USD/hour\",ylab=\"Relative frequency / bin width\",main=\"Actual raw wages: unequal bins\")\naxis(1,at=edges)\nrect(edges[-length(edges)],0,edges[-1],densities,col=\"#347c93\",border=\"black\")\ntext(edges[-length(edges)]+widths/2,densities,labels=counts,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),availableCount=length(raw),missingCount=nrow(rows)-length(raw),edges=as.list(edges),counts=as.list(counts),widths=as.list(widths),relativeFrequencies=as.list(relative),densities=as.list(densities),areas=as.list(densities*widths),densityArea=sum(densities*widths),insideCount=sum(counts),outsideCount=length(raw)-sum(counts),leftClosed=TRUE,lastRightClosed=TRUE,binChoiceChangesObservations=FALSE,unit=\"usd\"))\n",
        "codeFile": "data07-snippets/r/histogram-unequal-usd.R",
        "codeSha256": "a81b55cddf30f820dafe7a4fe285c2cf4074a031c0143295ea4cd218404b8d0e",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-unequal-usd-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            2,
            4,
            8,
            16,
            25
          ],
          "counts": [
            48,
            723,
            1759,
            467,
            20
          ],
          "widths": [
            2,
            2,
            4,
            8,
            9
          ],
          "relativeFrequencies": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densities": [
            0.007954922108054359,
            0.11982101425256877,
            0.14575737487570434,
            0.019348690752403048,
            0.000736566861856885
          ],
          "areas": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densityArea": 1,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "usd"
        },
        "plotFile": "data07-plots/histogram-unequal-usd-r.svg",
        "plotSha256": "c19cc131750f085655f1120b1e9d4d286906634b879c5896c8c34c37264daa0a",
        "plotGeneratedBy": "base R svg",
        "bins": "unequal",
        "unit": "usd",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "unequal-cents": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3613,\"availableCount\":3017,\"missingCount\":596,\"edges\":[0,200,400,800,1600,2500],\"counts\":[48,723,1759,467,20],\"widths\":[200,200,400,800,900],\"relativeFrequencies\":[0.015909844216108717,0.23964202850513755,0.58302949950281735,0.15478952601922438,0.0066291017567119657],\"densities\":[0.000079549221080543582,0.0011982101425256878,0.0014575737487570433,0.00019348690752403049,0.0000073656686185688512],\"areas\":[0.015909844216108717,0.23964202850513755,0.58302949950281735,0.15478952601922438,0.0066291017567119657],\"densityArea\":1,\"insideCount\":3017,\"outsideCount\":0,\"leftClosed\":true,\"lastRightClosed\":true,\"binChoiceChangesObservations\":false,\"unit\":\"cents\"}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "unequal-cents",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nraw <- as.numeric(rows$raw_hourly_wage1976_cents_source_decimal[rows$raw_hourly_wage1976_cents_source_decimal!=\"\"])\ncents_edges <- c(0,200,400,800,1600,2500)\nedges <- c(0,200,400,800,1600,2500)\ncounts <- vapply(seq_len(length(edges)-1),function(i) sum(raw>=cents_edges[i] & (raw<cents_edges[i+1] | (i==length(edges)-1 & raw==cents_edges[i+1]))),numeric(1))\nwidths <- diff(edges); relative <- counts/length(raw); densities <- relative/widths\nplot(NA,xlim=range(edges),ylim=c(0,max(densities)*1.18),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"1976 cents/hour\",ylab=\"Relative frequency / bin width\",main=\"Actual raw wages: unequal bins\")\naxis(1,at=edges)\nrect(edges[-length(edges)],0,edges[-1],densities,col=\"#347c93\",border=\"black\")\ntext(edges[-length(edges)]+widths/2,densities,labels=counts,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),availableCount=length(raw),missingCount=nrow(rows)-length(raw),edges=as.list(edges),counts=as.list(counts),widths=as.list(widths),relativeFrequencies=as.list(relative),densities=as.list(densities),areas=as.list(densities*widths),densityArea=sum(densities*widths),insideCount=sum(counts),outsideCount=length(raw)-sum(counts),leftClosed=TRUE,lastRightClosed=TRUE,binChoiceChangesObservations=FALSE,unit=\"cents\"))\n",
        "codeFile": "data07-snippets/r/histogram-unequal-cents.R",
        "codeSha256": "cf6bb20ab33429edcb192b19395f44a2caed93710e6cb32dd1077514efae81c9",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-unequal-cents-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            200,
            400,
            800,
            1600,
            2500
          ],
          "counts": [
            48,
            723,
            1759,
            467,
            20
          ],
          "widths": [
            200,
            200,
            400,
            800,
            900
          ],
          "relativeFrequencies": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densities": [
            7.954922108054358e-05,
            0.0011982101425256878,
            0.0014575737487570433,
            0.0001934869075240305,
            7.365668618568851e-06
          ],
          "areas": [
            0.015909844216108717,
            0.23964202850513755,
            0.5830294995028173,
            0.15478952601922438,
            0.006629101756711966
          ],
          "densityArea": 1,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "cents"
        },
        "plotFile": "data07-plots/histogram-unequal-cents-r.svg",
        "plotSha256": "0f7848040041b3aaaf2543507f2ac1fbdb8fb5dcd738e1918ad4cbc4a33bb18a",
        "plotGeneratedBy": "base R svg",
        "bins": "unequal",
        "unit": "cents",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "equal-usd": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3613,\"availableCount\":3017,\"missingCount\":596,\"edges\":[0,5,10,15,20,25],\"counts\":[1284,1540,169,19,5],\"widths\":[5,5,5,5,5],\"relativeFrequencies\":[0.42558833278090819,0.51044083526682138,0.056015909844216109,0.0062976466688763671,0.0016572754391779914],\"densities\":[0.085117666556181637,0.10208816705336428,0.011203181968843222,0.0012595293337752734,0.00033145508783559831],\"areas\":[0.42558833278090819,0.51044083526682138,0.056015909844216109,0.0062976466688763671,0.0016572754391779914],\"densityArea\":1,\"insideCount\":3017,\"outsideCount\":0,\"leftClosed\":true,\"lastRightClosed\":true,\"binChoiceChangesObservations\":false,\"unit\":\"usd\"}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "equal-usd",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nraw <- as.numeric(rows$raw_hourly_wage1976_cents_source_decimal[rows$raw_hourly_wage1976_cents_source_decimal!=\"\"])\ncents_edges <- c(0,500,1000,1500,2000,2500)\nedges <- c(0,5,10,15,20,25)\ncounts <- vapply(seq_len(length(edges)-1),function(i) sum(raw>=cents_edges[i] & (raw<cents_edges[i+1] | (i==length(edges)-1 & raw==cents_edges[i+1]))),numeric(1))\nwidths <- diff(edges); relative <- counts/length(raw); densities <- relative/widths\nplot(NA,xlim=range(edges),ylim=c(0,max(densities)*1.18),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"1976 USD/hour\",ylab=\"Relative frequency / bin width\",main=\"Actual raw wages: equal bins\")\naxis(1,at=edges)\nrect(edges[-length(edges)],0,edges[-1],densities,col=\"#347c93\",border=\"black\")\ntext(edges[-length(edges)]+widths/2,densities,labels=counts,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),availableCount=length(raw),missingCount=nrow(rows)-length(raw),edges=as.list(edges),counts=as.list(counts),widths=as.list(widths),relativeFrequencies=as.list(relative),densities=as.list(densities),areas=as.list(densities*widths),densityArea=sum(densities*widths),insideCount=sum(counts),outsideCount=length(raw)-sum(counts),leftClosed=TRUE,lastRightClosed=TRUE,binChoiceChangesObservations=FALSE,unit=\"usd\"))\n",
        "codeFile": "data07-snippets/r/histogram-equal-usd.R",
        "codeSha256": "0a79fd2bdf11a2f92843393ac729e410ede78636bbc1ab017750aa7807201ad6",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-equal-usd-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            5,
            10,
            15,
            20,
            25
          ],
          "counts": [
            1284,
            1540,
            169,
            19,
            5
          ],
          "widths": [
            5,
            5,
            5,
            5,
            5
          ],
          "relativeFrequencies": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densities": [
            0.08511766655618164,
            0.10208816705336428,
            0.011203181968843222,
            0.0012595293337752734,
            0.0003314550878355983
          ],
          "areas": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densityArea": 1,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "usd"
        },
        "plotFile": "data07-plots/histogram-equal-usd-r.svg",
        "plotSha256": "7499fbbc28dde00c2ac9354e91e5a4fcfc559272f39ab5a786240566f1135e9c",
        "plotGeneratedBy": "base R svg",
        "bins": "equal",
        "unit": "usd",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      },
      "equal-cents": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3613,\"availableCount\":3017,\"missingCount\":596,\"edges\":[0,500,1000,1500,2000,2500],\"counts\":[1284,1540,169,19,5],\"widths\":[500,500,500,500,500],\"relativeFrequencies\":[0.42558833278090819,0.51044083526682138,0.056015909844216109,0.0062976466688763671,0.0016572754391779914],\"densities\":[0.00085117666556181642,0.0010208816705336427,0.00011203181968843221,0.000012595293337752735,0.0000033145508783559829],\"areas\":[0.42558833278090819,0.51044083526682138,0.056015909844216109,0.0062976466688763671,0.0016572754391779914],\"densityArea\":1,\"insideCount\":3017,\"outsideCount\":0,\"leftClosed\":true,\"lastRightClosed\":true,\"binChoiceChangesObservations\":false,\"unit\":\"cents\"}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "equal-cents",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nraw <- as.numeric(rows$raw_hourly_wage1976_cents_source_decimal[rows$raw_hourly_wage1976_cents_source_decimal!=\"\"])\ncents_edges <- c(0,500,1000,1500,2000,2500)\nedges <- c(0,500,1000,1500,2000,2500)\ncounts <- vapply(seq_len(length(edges)-1),function(i) sum(raw>=cents_edges[i] & (raw<cents_edges[i+1] | (i==length(edges)-1 & raw==cents_edges[i+1]))),numeric(1))\nwidths <- diff(edges); relative <- counts/length(raw); densities <- relative/widths\nplot(NA,xlim=range(edges),ylim=c(0,max(densities)*1.18),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"1976 cents/hour\",ylab=\"Relative frequency / bin width\",main=\"Actual raw wages: equal bins\")\naxis(1,at=edges)\nrect(edges[-length(edges)],0,edges[-1],densities,col=\"#347c93\",border=\"black\")\ntext(edges[-length(edges)]+widths/2,densities,labels=counts,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),availableCount=length(raw),missingCount=nrow(rows)-length(raw),edges=as.list(edges),counts=as.list(counts),widths=as.list(widths),relativeFrequencies=as.list(relative),densities=as.list(densities),areas=as.list(densities*widths),densityArea=sum(densities*widths),insideCount=sum(counts),outsideCount=length(raw)-sum(counts),leftClosed=TRUE,lastRightClosed=TRUE,binChoiceChangesObservations=FALSE,unit=\"cents\"))\n",
        "codeFile": "data07-snippets/r/histogram-equal-cents.R",
        "codeSha256": "b3d0a387448d17fdcf8c3bbe1b0350ced247f5f6c20f338b27a87f8e76350aeb",
        "inputFile": "data07-sources/actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
        "inputSha256": "715fd317e29a8b7fd0a44a378d4d04e3dd058caacb17c48a5652ff48219b584c",
        "arguments": [
          "data07-sources\\actual3613-raw-wage-and-source-trimmed-log-missing-preserved.csv",
          "data07-plots\\histogram-equal-cents-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3613,
          "availableCount": 3017,
          "missingCount": 596,
          "edges": [
            0,
            500,
            1000,
            1500,
            2000,
            2500
          ],
          "counts": [
            1284,
            1540,
            169,
            19,
            5
          ],
          "widths": [
            500,
            500,
            500,
            500,
            500
          ],
          "relativeFrequencies": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densities": [
            0.0008511766655618164,
            0.0010208816705336427,
            0.00011203181968843221,
            1.2595293337752735e-05,
            3.314550878355983e-06
          ],
          "areas": [
            0.4255883327809082,
            0.5104408352668214,
            0.05601590984421611,
            0.006297646668876367,
            0.0016572754391779914
          ],
          "densityArea": 1,
          "insideCount": 3017,
          "outsideCount": 0,
          "leftClosed": true,
          "lastRightClosed": true,
          "binChoiceChangesObservations": false,
          "unit": "cents"
        },
        "plotFile": "data07-plots/histogram-equal-cents-r.svg",
        "plotSha256": "2b63378e6eb1a4cba3ecf48e93f90512b3d93096fe6b3a79301dd3cdf1af2f84",
        "plotGeneratedBy": "base R svg",
        "bins": "equal",
        "unit": "cents",
        "plotReading": "Widths are actual horizontal intervals; bar area, not height alone, equals relative frequency."
      }
    }
  },
  "axis": {
    "python": {
      "zero": {
        "returnCode": 0,
        "stdout": "{\"toyData\": true, \"values\": [95, 100], \"labels\": [\"A\", \"B\"], \"baseline\": 0, \"barLengths\": [95, 100], \"actualValueRatio\": 1.0526315789473684, \"barLengthRatio\": 1.0526315789473684, \"actualDifference\": 5, \"truncatedBaseline\": false, \"observationsChanged\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "zero",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nvalues=[95,100];labels=[\"A\",\"B\"];baseline=0\nheights=[v-baseline for v in values]\nax.bar(labels,heights,bottom=baseline,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(baseline,105),ylabel=\"Toy value\",title='Toy A=95, B=100; displayed baseline 0')\nfor x,y in enumerate(values):ax.text(x,y,str(y),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(toyData=True,values=values,labels=labels,baseline=baseline,barLengths=heights,actualValueRatio=values[1]/values[0],barLengthRatio=heights[1]/heights[0],actualDifference=5,truncatedBaseline=baseline!=0,observationsChanged=False)))\n",
        "codeFile": "data07-snippets/python/axis-zero.py",
        "codeSha256": "76cce1c3f22d384fce3ce9ce2be266108ad2b7c88e9b5551ebb5e7ed1a85b261",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [
          "-",
          "data07-plots\\axis-zero-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "toyData": true,
          "values": [
            95,
            100
          ],
          "labels": [
            "A",
            "B"
          ],
          "baseline": 0,
          "barLengths": [
            95,
            100
          ],
          "actualValueRatio": 1.0526315789473684,
          "barLengthRatio": 1.0526315789473684,
          "actualDifference": 5,
          "truncatedBaseline": false,
          "observationsChanged": false
        },
        "plotFile": "data07-plots/axis-zero-python.svg",
        "plotSha256": "885ddff1f8d9f89e5c3b53eb3d264c836d5f1fefcc0557b0f3976b19aea7e497",
        "plotGeneratedBy": "Matplotlib",
        "view": "zero",
        "toyData": true
      },
      "zoom": {
        "returnCode": 0,
        "stdout": "{\"toyData\": true, \"values\": [95, 100], \"labels\": [\"A\", \"B\"], \"baseline\": 90, \"barLengths\": [5, 10], \"actualValueRatio\": 1.0526315789473684, \"barLengthRatio\": 2.0, \"actualDifference\": 5, \"truncatedBaseline\": true, \"observationsChanged\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "zoom",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nvalues=[95,100];labels=[\"A\",\"B\"];baseline=90\nheights=[v-baseline for v in values]\nax.bar(labels,heights,bottom=baseline,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(baseline,105),ylabel=\"Toy value\",title='Toy A=95, B=100; displayed baseline 90')\nfor x,y in enumerate(values):ax.text(x,y,str(y),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(toyData=True,values=values,labels=labels,baseline=baseline,barLengths=heights,actualValueRatio=values[1]/values[0],barLengthRatio=heights[1]/heights[0],actualDifference=5,truncatedBaseline=baseline!=0,observationsChanged=False)))\n",
        "codeFile": "data07-snippets/python/axis-zoom.py",
        "codeSha256": "7230de64e4a831d6bc454848c46a731d156d2be7a77343ab8fdb1970b7fb812e",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [
          "-",
          "data07-plots\\axis-zoom-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "toyData": true,
          "values": [
            95,
            100
          ],
          "labels": [
            "A",
            "B"
          ],
          "baseline": 90,
          "barLengths": [
            5,
            10
          ],
          "actualValueRatio": 1.0526315789473684,
          "barLengthRatio": 2.0,
          "actualDifference": 5,
          "truncatedBaseline": true,
          "observationsChanged": false
        },
        "plotFile": "data07-plots/axis-zoom-python.svg",
        "plotSha256": "2850012bec7f77a0d4b11ca9c8661600d219de74fdbee07a40215be243e179c4",
        "plotGeneratedBy": "Matplotlib",
        "view": "zoom",
        "toyData": true
      }
    },
    "r": {
      "zero": {
        "returnCode": 0,
        "stdout": "{\"toyData\":true,\"values\":[95,100],\"labels\":[\"A\",\"B\"],\"baseline\":0,\"barLengths\":[95,100],\"actualValueRatio\":1.0526315789473684,\"barLengthRatio\":1.0526315789473684,\"actualDifference\":5,\"truncatedBaseline\":false,\"observationsChanged\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "zero",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nvalues <- c(95,100); baseline <- 0; heights <- values-baseline\nplot(NA,xlim=c(.4,2.6),ylim=c(baseline,105),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"\",ylab=\"Toy value\",main=\"Toy A=95, B=100; displayed baseline 0\")\naxis(1,at=1:2,labels=c(\"A\",\"B\"))\nrect((1:2)-.3,baseline,(1:2)+.3,values,col=c(\"#347c93\",\"#ba673b\"))\ntext(1:2,values,labels=values,pos=3)\ninvisible(dev.off())\nemit(list(toyData=TRUE,values=as.list(values),labels=as.list(c(\"A\",\"B\")),baseline=baseline,barLengths=as.list(heights),actualValueRatio=values[2]/values[1],barLengthRatio=heights[2]/heights[1],actualDifference=5,truncatedBaseline=baseline!=0,observationsChanged=FALSE))\n",
        "codeFile": "data07-snippets/r/axis-zero.R",
        "codeSha256": "de2939e3e3dd88c07ca7ffdda0f52ba08a1833df2b14ef89d9f8b7c74deb298d",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [
          "-",
          "data07-plots\\axis-zero-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "toyData": true,
          "values": [
            95,
            100
          ],
          "labels": [
            "A",
            "B"
          ],
          "baseline": 0,
          "barLengths": [
            95,
            100
          ],
          "actualValueRatio": 1.0526315789473684,
          "barLengthRatio": 1.0526315789473684,
          "actualDifference": 5,
          "truncatedBaseline": false,
          "observationsChanged": false
        },
        "plotFile": "data07-plots/axis-zero-r.svg",
        "plotSha256": "4cc1850fb46ab8571535a39d407c30cf8ae60c02c28709eaa3d36241b7daffb7",
        "plotGeneratedBy": "base R svg",
        "view": "zero",
        "toyData": true
      },
      "zoom": {
        "returnCode": 0,
        "stdout": "{\"toyData\":true,\"values\":[95,100],\"labels\":[\"A\",\"B\"],\"baseline\":90,\"barLengths\":[5,10],\"actualValueRatio\":1.0526315789473684,\"barLengthRatio\":2,\"actualDifference\":5,\"truncatedBaseline\":true,\"observationsChanged\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "zoom",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nvalues <- c(95,100); baseline <- 90; heights <- values-baseline\nplot(NA,xlim=c(.4,2.6),ylim=c(baseline,105),xaxs=\"i\",yaxs=\"i\",xaxt=\"n\",xlab=\"\",ylab=\"Toy value\",main=\"Toy A=95, B=100; displayed baseline 90\")\naxis(1,at=1:2,labels=c(\"A\",\"B\"))\nrect((1:2)-.3,baseline,(1:2)+.3,values,col=c(\"#347c93\",\"#ba673b\"))\ntext(1:2,values,labels=values,pos=3)\ninvisible(dev.off())\nemit(list(toyData=TRUE,values=as.list(values),labels=as.list(c(\"A\",\"B\")),baseline=baseline,barLengths=as.list(heights),actualValueRatio=values[2]/values[1],barLengthRatio=heights[2]/heights[1],actualDifference=5,truncatedBaseline=baseline!=0,observationsChanged=FALSE))\n",
        "codeFile": "data07-snippets/r/axis-zoom.R",
        "codeSha256": "2ab4c716b4d1a4552a89d225e6a83ac4b9abc1fb611c94595a6bdc42c43f92a9",
        "inputFile": null,
        "inputSha256": null,
        "arguments": [
          "-",
          "data07-plots\\axis-zoom-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "toyData": true,
          "values": [
            95,
            100
          ],
          "labels": [
            "A",
            "B"
          ],
          "baseline": 90,
          "barLengths": [
            5,
            10
          ],
          "actualValueRatio": 1.0526315789473684,
          "barLengthRatio": 2,
          "actualDifference": 5,
          "truncatedBaseline": true,
          "observationsChanged": false
        },
        "plotFile": "data07-plots/axis-zoom-r.svg",
        "plotSha256": "ba38f107f89462d37818c366223c878b8279d7c651c8d1dac50a182d34e4d31b",
        "plotGeneratedBy": "base R svg",
        "view": "zoom",
        "toyData": true
      }
    }
  },
  "target": {
    "python": {
      "uniform": {
        "returnCode": 0,
        "stdout": "{\"countryCount\": 16, \"selectedPopulation\": 4462826129, \"labels\": [\"IND\", \"VNM\", \"IDN\", \"ZAF\", \"BRA\", \"MEX\", \"CHN\", \"KOR\", \"JPN\", \"FRA\", \"DEU\", \"CAN\", \"GBR\", \"AUS\", \"USA\", \"SGP\"], \"values\": [2366.8328910323, 4012.50779921084, 4367.94741847938, 5715.47531469148, 9566.74518687619, 10284.0336925726, 13119.1076099516, 37048.4264001496, 37976.6371788298, 39683.3953489029, 44027.7631554469, 45061.3864587285, 47900.9680144146, 61486.38147544, 66856.5131698371, 68129.6960402288], \"weights\": [0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625], \"weightedMean\": 31100.238572174538, \"weightedMeanExact\": \"49760381715479259/1600000000000\", \"weighting\": \"uniform\", \"connectedCountryTrajectory\": false, \"individualIncomeDistributionObserved\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "uniform",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nvalues=[Fraction(r[\"actual_GDPpc_constant2015USD_source_decimal\"]) for r in rows]\npopulation=[int(r[\"actual_population_source_decimal\"]) for r in rows]\nweights=[Fraction(1,len(rows)) for r in rows] if 'uniform'==\"uniform\" else [Fraction(p,sum(population)) for p in population]\nmean=sum(v*w for v,w in zip(values,weights));labels=[r[\"country_ISO\"] for r in rows]\nax.scatter(range(len(rows)),list(map(float,values)),color=\"#347c93\",s=25)\nax.axhline(float(mean),color=\"#ba673b\",linestyle=\"--\",label=\"Selected mean\")\nax.set_xticks(range(len(rows)),labels,rotation=65)\nax.set(ylim=(0,max(map(float,values))*1.12),ylabel=\"GDP per capita, constant2015 USD\",xlabel=\"Selected country labels\",title='Actual2024 country indicators; uniform target')\nax.legend(loc=\"upper left\")\nsave_plot()\nprint(json.dumps(dict(countryCount=len(rows),selectedPopulation=sum(population),labels=labels,values=list(map(float,values)),weights=list(map(float,weights)),weightedMean=float(mean),weightedMeanExact=str(mean),weighting='uniform',connectedCountryTrajectory=False,individualIncomeDistributionObserved=False)))\n",
        "codeFile": "data07-snippets/python/target-uniform.py",
        "codeSha256": "7636293e0e30d821e75fa4e47b0c17810b94de68ce2e9aaffe3efaaa3ece55a8",
        "inputFile": "data07-sources/actual16-country-indicators-and-explicit-target-weights.csv",
        "inputSha256": "c667a97dedac9a5d8487822982af1ef268e856af61f46b89dc90f66dd833b507",
        "arguments": [
          "data07-sources\\actual16-country-indicators-and-explicit-target-weights.csv",
          "data07-plots\\target-uniform-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "countryCount": 16,
          "selectedPopulation": 4462826129,
          "labels": [
            "IND",
            "VNM",
            "IDN",
            "ZAF",
            "BRA",
            "MEX",
            "CHN",
            "KOR",
            "JPN",
            "FRA",
            "DEU",
            "CAN",
            "GBR",
            "AUS",
            "USA",
            "SGP"
          ],
          "values": [
            2366.8328910323,
            4012.50779921084,
            4367.94741847938,
            5715.47531469148,
            9566.74518687619,
            10284.0336925726,
            13119.1076099516,
            37048.4264001496,
            37976.6371788298,
            39683.3953489029,
            44027.7631554469,
            45061.3864587285,
            47900.9680144146,
            61486.38147544,
            66856.5131698371,
            68129.6960402288
          ],
          "weights": [
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625
          ],
          "weightedMean": 31100.238572174538,
          "weightedMeanExact": "49760381715479259/1600000000000",
          "weighting": "uniform",
          "connectedCountryTrajectory": false,
          "individualIncomeDistributionObserved": false
        },
        "plotFile": "data07-plots/target-uniform-python.svg",
        "plotSha256": "6c100f23b2c4e334dc309d9f00acd986f970f35b225d0ab53ed57f9f1f1fcf97",
        "plotGeneratedBy": "Matplotlib",
        "weighting": "uniform",
        "plotReading": "Dots are actual country-level indicators; the line is the selected aggregate target, not a fitted time trajectory."
      },
      "population": {
        "returnCode": 0,
        "stdout": "{\"countryCount\": 16, \"selectedPopulation\": 4462826129, \"labels\": [\"IND\", \"VNM\", \"IDN\", \"ZAF\", \"BRA\", \"MEX\", \"CHN\", \"KOR\", \"JPN\", \"FRA\", \"DEU\", \"CAN\", \"GBR\", \"AUS\", \"USA\", \"SGP\"], \"values\": [2366.8328910323, 4012.50779921084, 4367.94741847938, 5715.47531469148, 9566.74518687619, 10284.0336925726, 13119.1076099516, 37048.4264001496, 37976.6371788298, 39683.3953489029, 44027.7631554469, 45061.3864587285, 47900.9680144146, 61486.38147544, 66856.5131698371, 68129.6960402288], \"weights\": [0.32511591289018377, 0.022628640032326026, 0.06352206489915888, 0.014342299061142743, 0.047503211389394465, 0.029322452458913618, 0.31571362165429323, 0.011596029848376824, 0.02777956555250777, 0.01536059237319214, 0.01871383526624503, 0.009245784578492146, 0.01552401953322883, 0.00609351232020628, 0.07618575924135, 0.0013526989009882621], \"weightedMean\": 15756.27445695627, \"weightedMeanExact\": \"1406350266843994525066371/89256522580000000000\", \"weighting\": \"population\", \"connectedCountryTrajectory\": false, \"individualIncomeDistributionObserved\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "population",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\nvalues=[Fraction(r[\"actual_GDPpc_constant2015USD_source_decimal\"]) for r in rows]\npopulation=[int(r[\"actual_population_source_decimal\"]) for r in rows]\nweights=[Fraction(1,len(rows)) for r in rows] if 'population'==\"uniform\" else [Fraction(p,sum(population)) for p in population]\nmean=sum(v*w for v,w in zip(values,weights));labels=[r[\"country_ISO\"] for r in rows]\nax.scatter(range(len(rows)),list(map(float,values)),color=\"#347c93\",s=25)\nax.axhline(float(mean),color=\"#ba673b\",linestyle=\"--\",label=\"Selected mean\")\nax.set_xticks(range(len(rows)),labels,rotation=65)\nax.set(ylim=(0,max(map(float,values))*1.12),ylabel=\"GDP per capita, constant2015 USD\",xlabel=\"Selected country labels\",title='Actual2024 country indicators; population target')\nax.legend(loc=\"upper left\")\nsave_plot()\nprint(json.dumps(dict(countryCount=len(rows),selectedPopulation=sum(population),labels=labels,values=list(map(float,values)),weights=list(map(float,weights)),weightedMean=float(mean),weightedMeanExact=str(mean),weighting='population',connectedCountryTrajectory=False,individualIncomeDistributionObserved=False)))\n",
        "codeFile": "data07-snippets/python/target-population.py",
        "codeSha256": "078d39e7ad0af8d188d405f9011ac3c80bae763eb03ab03f56a21cd16f89fdd8",
        "inputFile": "data07-sources/actual16-country-indicators-and-explicit-target-weights.csv",
        "inputSha256": "c667a97dedac9a5d8487822982af1ef268e856af61f46b89dc90f66dd833b507",
        "arguments": [
          "data07-sources\\actual16-country-indicators-and-explicit-target-weights.csv",
          "data07-plots\\target-population-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "countryCount": 16,
          "selectedPopulation": 4462826129,
          "labels": [
            "IND",
            "VNM",
            "IDN",
            "ZAF",
            "BRA",
            "MEX",
            "CHN",
            "KOR",
            "JPN",
            "FRA",
            "DEU",
            "CAN",
            "GBR",
            "AUS",
            "USA",
            "SGP"
          ],
          "values": [
            2366.8328910323,
            4012.50779921084,
            4367.94741847938,
            5715.47531469148,
            9566.74518687619,
            10284.0336925726,
            13119.1076099516,
            37048.4264001496,
            37976.6371788298,
            39683.3953489029,
            44027.7631554469,
            45061.3864587285,
            47900.9680144146,
            61486.38147544,
            66856.5131698371,
            68129.6960402288
          ],
          "weights": [
            0.32511591289018377,
            0.022628640032326026,
            0.06352206489915888,
            0.014342299061142743,
            0.047503211389394465,
            0.029322452458913618,
            0.31571362165429323,
            0.011596029848376824,
            0.02777956555250777,
            0.01536059237319214,
            0.01871383526624503,
            0.009245784578492146,
            0.01552401953322883,
            0.00609351232020628,
            0.07618575924135,
            0.0013526989009882621
          ],
          "weightedMean": 15756.27445695627,
          "weightedMeanExact": "1406350266843994525066371/89256522580000000000",
          "weighting": "population",
          "connectedCountryTrajectory": false,
          "individualIncomeDistributionObserved": false
        },
        "plotFile": "data07-plots/target-population-python.svg",
        "plotSha256": "f43176bb370e8647a3603b765096a7563fc01ddd8871a2e95662187e56051307",
        "plotGeneratedBy": "Matplotlib",
        "weighting": "population",
        "plotReading": "Dots are actual country-level indicators; the line is the selected aggregate target, not a fitted time trajectory."
      }
    },
    "r": {
      "uniform": {
        "returnCode": 0,
        "stdout": "{\"countryCount\":16,\"selectedPopulation\":4462826129,\"labels\":[\"IND\",\"VNM\",\"IDN\",\"ZAF\",\"BRA\",\"MEX\",\"CHN\",\"KOR\",\"JPN\",\"FRA\",\"DEU\",\"CAN\",\"GBR\",\"AUS\",\"USA\",\"SGP\"],\"values\":[2366.8328910322998,4012.5077992108399,4367.9474184793798,5715.47531469148,9566.7451868761891,10284.033692572601,13119.107609951599,37048.426400149598,37976.637178829798,39683.395348902901,44027.763155446897,45061.386458728499,47900.968014414597,61486.381475440001,66856.513169837097,68129.696040228795],\"weights\":[0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625,0.0625],\"weightedMean\":31100.238572174534,\"weighting\":\"uniform\",\"connectedCountryTrajectory\":false,\"individualIncomeDistributionObserved\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "uniform",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nvalues <- as.numeric(rows$actual_GDPpc_constant2015USD_source_decimal)\npopulation <- as.numeric(rows$actual_population_source_decimal)\nweights <- if(\"uniform\"==\"uniform\") rep(1/nrow(rows),nrow(rows)) else population/sum(population)\nselected_mean <- sum(values*weights)\npar(mar=c(5.3,4.8,3.3,1.2))\nplot(seq_along(values),values,pch=19,col=\"#347c93\",xaxt=\"n\",ylim=c(0,max(values)*1.12),xlab=\"Selected country labels\",ylab=\"GDP per capita, constant2015 USD\",main=\"Actual2024 country indicators; uniform target\")\naxis(1,at=seq_along(values),labels=rows$country_ISO,las=2,cex.axis=.75)\nabline(h=selected_mean,col=\"#ba673b\",lty=2)\nlegend(\"topleft\",legend=\"Selected mean\",col=\"#ba673b\",lty=2,bty=\"n\")\ninvisible(dev.off())\nemit(list(countryCount=nrow(rows),selectedPopulation=sum(population),labels=as.list(rows$country_ISO),values=as.list(values),weights=as.list(weights),weightedMean=selected_mean,weighting=\"uniform\",connectedCountryTrajectory=FALSE,individualIncomeDistributionObserved=FALSE))\n",
        "codeFile": "data07-snippets/r/target-uniform.R",
        "codeSha256": "2a9b66c4c3afbb4b6b530efc9b16d608dcf9d1d97418435bef3c4e691082a165",
        "inputFile": "data07-sources/actual16-country-indicators-and-explicit-target-weights.csv",
        "inputSha256": "c667a97dedac9a5d8487822982af1ef268e856af61f46b89dc90f66dd833b507",
        "arguments": [
          "data07-sources\\actual16-country-indicators-and-explicit-target-weights.csv",
          "data07-plots\\target-uniform-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "countryCount": 16,
          "selectedPopulation": 4462826129,
          "labels": [
            "IND",
            "VNM",
            "IDN",
            "ZAF",
            "BRA",
            "MEX",
            "CHN",
            "KOR",
            "JPN",
            "FRA",
            "DEU",
            "CAN",
            "GBR",
            "AUS",
            "USA",
            "SGP"
          ],
          "values": [
            2366.8328910323,
            4012.50779921084,
            4367.94741847938,
            5715.47531469148,
            9566.74518687619,
            10284.0336925726,
            13119.1076099516,
            37048.4264001496,
            37976.6371788298,
            39683.3953489029,
            44027.7631554469,
            45061.3864587285,
            47900.9680144146,
            61486.38147544,
            66856.5131698371,
            68129.6960402288
          ],
          "weights": [
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625,
            0.0625
          ],
          "weightedMean": 31100.238572174534,
          "weighting": "uniform",
          "connectedCountryTrajectory": false,
          "individualIncomeDistributionObserved": false
        },
        "plotFile": "data07-plots/target-uniform-r.svg",
        "plotSha256": "97f198fa4fede6fabf8c54ea764d3548a96a37c86db0568e6efcf118c66efce7",
        "plotGeneratedBy": "base R svg",
        "weighting": "uniform",
        "plotReading": "Dots are actual country-level indicators; the line is the selected aggregate target, not a fitted time trajectory."
      },
      "population": {
        "returnCode": 0,
        "stdout": "{\"countryCount\":16,\"selectedPopulation\":4462826129,\"labels\":[\"IND\",\"VNM\",\"IDN\",\"ZAF\",\"BRA\",\"MEX\",\"CHN\",\"KOR\",\"JPN\",\"FRA\",\"DEU\",\"CAN\",\"GBR\",\"AUS\",\"USA\",\"SGP\"],\"values\":[2366.8328910322998,4012.5077992108399,4367.9474184793798,5715.47531469148,9566.7451868761891,10284.033692572601,13119.107609951599,37048.426400149598,37976.637178829798,39683.395348902901,44027.763155446897,45061.386458728499,47900.968014414597,61486.381475440001,66856.513169837097,68129.696040228795],\"weights\":[0.32511591289018377,0.022628640032326026,0.063522064899158875,0.014342299061142743,0.047503211389394465,0.029322452458913618,0.31571362165429323,0.011596029848376824,0.027779565552507771,0.01536059237319214,0.018713835266245031,0.0092457845784921465,0.015524019533228829,0.0060935123202062796,0.076185759241350001,0.0013526989009882621],\"weightedMean\":15756.274456956269,\"weighting\":\"population\",\"connectedCountryTrajectory\":false,\"individualIncomeDistributionObserved\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "population",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\nvalues <- as.numeric(rows$actual_GDPpc_constant2015USD_source_decimal)\npopulation <- as.numeric(rows$actual_population_source_decimal)\nweights <- if(\"population\"==\"uniform\") rep(1/nrow(rows),nrow(rows)) else population/sum(population)\nselected_mean <- sum(values*weights)\npar(mar=c(5.3,4.8,3.3,1.2))\nplot(seq_along(values),values,pch=19,col=\"#347c93\",xaxt=\"n\",ylim=c(0,max(values)*1.12),xlab=\"Selected country labels\",ylab=\"GDP per capita, constant2015 USD\",main=\"Actual2024 country indicators; population target\")\naxis(1,at=seq_along(values),labels=rows$country_ISO,las=2,cex.axis=.75)\nabline(h=selected_mean,col=\"#ba673b\",lty=2)\nlegend(\"topleft\",legend=\"Selected mean\",col=\"#ba673b\",lty=2,bty=\"n\")\ninvisible(dev.off())\nemit(list(countryCount=nrow(rows),selectedPopulation=sum(population),labels=as.list(rows$country_ISO),values=as.list(values),weights=as.list(weights),weightedMean=selected_mean,weighting=\"population\",connectedCountryTrajectory=FALSE,individualIncomeDistributionObserved=FALSE))\n",
        "codeFile": "data07-snippets/r/target-population.R",
        "codeSha256": "f99db1c6833ed367ede5c17dbcfda4fca8227f25fb7912f2166c04b0a76233ed",
        "inputFile": "data07-sources/actual16-country-indicators-and-explicit-target-weights.csv",
        "inputSha256": "c667a97dedac9a5d8487822982af1ef268e856af61f46b89dc90f66dd833b507",
        "arguments": [
          "data07-sources\\actual16-country-indicators-and-explicit-target-weights.csv",
          "data07-plots\\target-population-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "countryCount": 16,
          "selectedPopulation": 4462826129,
          "labels": [
            "IND",
            "VNM",
            "IDN",
            "ZAF",
            "BRA",
            "MEX",
            "CHN",
            "KOR",
            "JPN",
            "FRA",
            "DEU",
            "CAN",
            "GBR",
            "AUS",
            "USA",
            "SGP"
          ],
          "values": [
            2366.8328910323,
            4012.50779921084,
            4367.94741847938,
            5715.47531469148,
            9566.74518687619,
            10284.0336925726,
            13119.1076099516,
            37048.4264001496,
            37976.6371788298,
            39683.3953489029,
            44027.7631554469,
            45061.3864587285,
            47900.9680144146,
            61486.38147544,
            66856.5131698371,
            68129.6960402288
          ],
          "weights": [
            0.32511591289018377,
            0.022628640032326026,
            0.06352206489915888,
            0.014342299061142743,
            0.047503211389394465,
            0.029322452458913618,
            0.31571362165429323,
            0.011596029848376824,
            0.02777956555250777,
            0.01536059237319214,
            0.01871383526624503,
            0.009245784578492146,
            0.01552401953322883,
            0.00609351232020628,
            0.07618575924135,
            0.0013526989009882621
          ],
          "weightedMean": 15756.27445695627,
          "weighting": "population",
          "connectedCountryTrajectory": false,
          "individualIncomeDistributionObserved": false
        },
        "plotFile": "data07-plots/target-population-r.svg",
        "plotSha256": "7bba5cdbba2bdee18c884e67dcc9b30164a7271273ceaf5b4e7d034f9ddbaebf",
        "plotGeneratedBy": "base R svg",
        "weighting": "population",
        "plotReading": "Dots are actual country-level indicators; the line is the selected aggregate target, not a fitted time trajectory."
      }
    }
  },
  "denominator": {
    "python": {
      "count": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3150, \"complaintCodes\": [0, 1], \"churnCounts\": [295, 200], \"groupCounts\": [2909, 241], \"allChurn\": 495, \"mode\": \"count\", \"denominators\": [null, null], \"ratios\": [null, null], \"ratioExact\": [null, null], \"plotHeights\": [295, 200], \"heightsArePercent\": false, \"causalEffectIdentified\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "count",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\ngroups=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g for r in rows) for g in [0,1]]\ncounts=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g and Fraction(r[\"churn_code_source_decimal\"])==1 for r in rows) for g in [0,1]]\ndenominators=([None,None] if 'count'==\"count\" else groups if 'count'==\"withinComplaint\" else [sum(counts)]*2 if 'count'==\"amongChurn\" else [len(rows)]*2)\nratios=[None,None] if 'count'==\"count\" else [Fraction(c,d) for c,d in zip(counts,denominators)]\nheights=counts if 'count'==\"count\" else [100*float(v) for v in ratios]\nlabels=[\"No complaint\",\"Complaint\"]\nax.bar(labels,heights,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(0,max(heights)*1.22),ylabel='Churn records (count)',title=\"Actual retained customer records\")\nfor x,h,c,d in zip(range(2),heights,counts,denominators):ax.text(x,h,str(c) if d is None else str(c)+\"/\"+str(d),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),complaintCodes=[0,1],churnCounts=counts,groupCounts=groups,allChurn=sum(counts),mode='count',denominators=denominators,ratios=[float(v) if v is not None else None for v in ratios],ratioExact=[str(v) if v is not None else None for v in ratios],plotHeights=heights,heightsArePercent='count'!=\"count\",causalEffectIdentified=False)))\n",
        "codeFile": "data07-snippets/python/denominator-count.py",
        "codeSha256": "b0af41751da03698491bc58c16ee5a879be60df7de5cdd3c869facb1b8f6aba8",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-count-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "count",
          "denominators": [
            null,
            null
          ],
          "ratios": [
            null,
            null
          ],
          "ratioExact": [
            null,
            null
          ],
          "plotHeights": [
            295,
            200
          ],
          "heightsArePercent": false,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-count-python.svg",
        "plotSha256": "3824cccffcd5c0797c2d1e05e79a23df3623271957d7b1a9128f7e30442e6e37",
        "plotGeneratedBy": "Matplotlib",
        "mode": "count",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "withinComplaint": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3150, \"complaintCodes\": [0, 1], \"churnCounts\": [295, 200], \"groupCounts\": [2909, 241], \"allChurn\": 495, \"mode\": \"withinComplaint\", \"denominators\": [2909, 241], \"ratios\": [0.10140941904434514, 0.8298755186721992], \"ratioExact\": [\"295/2909\", \"200/241\"], \"plotHeights\": [10.140941904434515, 82.98755186721992], \"heightsArePercent\": true, \"causalEffectIdentified\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "withinComplaint",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\ngroups=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g for r in rows) for g in [0,1]]\ncounts=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g and Fraction(r[\"churn_code_source_decimal\"])==1 for r in rows) for g in [0,1]]\ndenominators=([None,None] if 'withinComplaint'==\"count\" else groups if 'withinComplaint'==\"withinComplaint\" else [sum(counts)]*2 if 'withinComplaint'==\"amongChurn\" else [len(rows)]*2)\nratios=[None,None] if 'withinComplaint'==\"count\" else [Fraction(c,d) for c,d in zip(counts,denominators)]\nheights=counts if 'withinComplaint'==\"count\" else [100*float(v) for v in ratios]\nlabels=[\"No complaint\",\"Complaint\"]\nax.bar(labels,heights,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(0,max(heights)*1.22),ylabel='Churn / complaint group (%)',title=\"Actual retained customer records\")\nfor x,h,c,d in zip(range(2),heights,counts,denominators):ax.text(x,h,str(c) if d is None else str(c)+\"/\"+str(d),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),complaintCodes=[0,1],churnCounts=counts,groupCounts=groups,allChurn=sum(counts),mode='withinComplaint',denominators=denominators,ratios=[float(v) if v is not None else None for v in ratios],ratioExact=[str(v) if v is not None else None for v in ratios],plotHeights=heights,heightsArePercent='withinComplaint'!=\"count\",causalEffectIdentified=False)))\n",
        "codeFile": "data07-snippets/python/denominator-withinComplaint.py",
        "codeSha256": "bed39f199972aa7e8204d12f2b526c97f4190aa8177b14a9fd6e7a66ab06e163",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-withinComplaint-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "withinComplaint",
          "denominators": [
            2909,
            241
          ],
          "ratios": [
            0.10140941904434514,
            0.8298755186721992
          ],
          "ratioExact": [
            "295/2909",
            "200/241"
          ],
          "plotHeights": [
            10.140941904434515,
            82.98755186721992
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-withinComplaint-python.svg",
        "plotSha256": "108608cdb61e866f092ac3ade1ee59e147b119b7d09617f541d1e3a23d5bd5c5",
        "plotGeneratedBy": "Matplotlib",
        "mode": "withinComplaint",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "amongChurn": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3150, \"complaintCodes\": [0, 1], \"churnCounts\": [295, 200], \"groupCounts\": [2909, 241], \"allChurn\": 495, \"mode\": \"amongChurn\", \"denominators\": [495, 495], \"ratios\": [0.5959595959595959, 0.40404040404040403], \"ratioExact\": [\"59/99\", \"40/99\"], \"plotHeights\": [59.59595959595959, 40.4040404040404], \"heightsArePercent\": true, \"causalEffectIdentified\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "amongChurn",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\ngroups=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g for r in rows) for g in [0,1]]\ncounts=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g and Fraction(r[\"churn_code_source_decimal\"])==1 for r in rows) for g in [0,1]]\ndenominators=([None,None] if 'amongChurn'==\"count\" else groups if 'amongChurn'==\"withinComplaint\" else [sum(counts)]*2 if 'amongChurn'==\"amongChurn\" else [len(rows)]*2)\nratios=[None,None] if 'amongChurn'==\"count\" else [Fraction(c,d) for c,d in zip(counts,denominators)]\nheights=counts if 'amongChurn'==\"count\" else [100*float(v) for v in ratios]\nlabels=[\"No complaint\",\"Complaint\"]\nax.bar(labels,heights,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(0,max(heights)*1.22),ylabel='Complaint group / all churn (%)',title=\"Actual retained customer records\")\nfor x,h,c,d in zip(range(2),heights,counts,denominators):ax.text(x,h,str(c) if d is None else str(c)+\"/\"+str(d),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),complaintCodes=[0,1],churnCounts=counts,groupCounts=groups,allChurn=sum(counts),mode='amongChurn',denominators=denominators,ratios=[float(v) if v is not None else None for v in ratios],ratioExact=[str(v) if v is not None else None for v in ratios],plotHeights=heights,heightsArePercent='amongChurn'!=\"count\",causalEffectIdentified=False)))\n",
        "codeFile": "data07-snippets/python/denominator-amongChurn.py",
        "codeSha256": "bd6417ffb0612a0c5534b819dfa928a2fd7dea675c9b6193175a09a6a7500bec",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-amongChurn-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "amongChurn",
          "denominators": [
            495,
            495
          ],
          "ratios": [
            0.5959595959595959,
            0.40404040404040403
          ],
          "ratioExact": [
            "59/99",
            "40/99"
          ],
          "plotHeights": [
            59.59595959595959,
            40.4040404040404
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-amongChurn-python.svg",
        "plotSha256": "62eea1db75cc951692ba7d5df1a9aaad9588a3e1e60282f5b6238240a298a49e",
        "plotGeneratedBy": "Matplotlib",
        "mode": "amongChurn",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "joint": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\": 3150, \"complaintCodes\": [0, 1], \"churnCounts\": [295, 200], \"groupCounts\": [2909, 241], \"allChurn\": 495, \"mode\": \"joint\", \"denominators\": [3150, 3150], \"ratios\": [0.09365079365079365, 0.06349206349206349], \"ratioExact\": [\"59/630\", \"4/63\"], \"plotHeights\": [9.365079365079366, 6.349206349206349], \"heightsArePercent\": true, \"causalEffectIdentified\": false}\n",
        "stderr": "",
        "language": "python",
        "id": "joint",
        "code": "import sys\nsys.stdout.reconfigure(encoding=\"utf-8\")\nsys.stderr.reconfigure(encoding=\"utf-8\")\nimport csv,json\nfrom pathlib import Path\nfrom fractions import Fraction\ndef load_csv(path):\n    with open(path,encoding=\"utf-8-sig\",newline=\"\") as handle:\n        return list(csv.DictReader(handle))\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({\"svg.fonttype\":\"none\",\"svg.hashsalt\":\"DATA07-fixed-plot\",\"font.family\":\"DejaVu Sans\",\"font.size\":10})\nplot_file=Path(sys.argv[2])\nfig,ax=plt.subplots(figsize=(8,4.6))\ndef save_plot():\n    fig.tight_layout()\n    fig.savefig(plot_file,format=\"svg\",metadata={\"Date\":None,\"Creator\":\"DATA07 actual Matplotlib program\"})\n    plt.close(fig)\nrows=load_csv(sys.argv[1])\ngroups=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g for r in rows) for g in [0,1]]\ncounts=[sum(Fraction(r[\"complaint_code_source_decimal\"])==g and Fraction(r[\"churn_code_source_decimal\"])==1 for r in rows) for g in [0,1]]\ndenominators=([None,None] if 'joint'==\"count\" else groups if 'joint'==\"withinComplaint\" else [sum(counts)]*2 if 'joint'==\"amongChurn\" else [len(rows)]*2)\nratios=[None,None] if 'joint'==\"count\" else [Fraction(c,d) for c,d in zip(counts,denominators)]\nheights=counts if 'joint'==\"count\" else [100*float(v) for v in ratios]\nlabels=[\"No complaint\",\"Complaint\"]\nax.bar(labels,heights,color=[\"#347c93\",\"#ba673b\"],edgecolor=\"black\",width=.6)\nax.set(ylim=(0,max(heights)*1.22),ylabel='Group and churn / all records (%)',title=\"Actual retained customer records\")\nfor x,h,c,d in zip(range(2),heights,counts,denominators):ax.text(x,h,str(c) if d is None else str(c)+\"/\"+str(d),ha=\"center\",va=\"bottom\")\nsave_plot()\nprint(json.dumps(dict(sourceCount=len(rows),complaintCodes=[0,1],churnCounts=counts,groupCounts=groups,allChurn=sum(counts),mode='joint',denominators=denominators,ratios=[float(v) if v is not None else None for v in ratios],ratioExact=[str(v) if v is not None else None for v in ratios],plotHeights=heights,heightsArePercent='joint'!=\"count\",causalEffectIdentified=False)))\n",
        "codeFile": "data07-snippets/python/denominator-joint.py",
        "codeSha256": "b3fdbb290483ba1b871a76625275ad48a769cee409ba74f64d8a5ce7ff463fdb",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-joint-python.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "joint",
          "denominators": [
            3150,
            3150
          ],
          "ratios": [
            0.09365079365079365,
            0.06349206349206349
          ],
          "ratioExact": [
            "59/630",
            "4/63"
          ],
          "plotHeights": [
            9.365079365079366,
            6.349206349206349
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-joint-python.svg",
        "plotSha256": "1924cbb33373545cca13ea186943117065a8d44d6454d8641fedcd39bdcd1a0a",
        "plotGeneratedBy": "Matplotlib",
        "mode": "joint",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      }
    },
    "r": {
      "count": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3150,\"complaintCodes\":[0,1],\"churnCounts\":[295,200],\"groupCounts\":[2909,241],\"allChurn\":495,\"mode\":\"count\",\"denominators\":[null,null],\"ratios\":[null,null],\"plotHeights\":[295,200],\"heightsArePercent\":false,\"causalEffectIdentified\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "count",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\ncomplaint <- as.numeric(rows$complaint_code_source_decimal)\nchurn <- as.numeric(rows$churn_code_source_decimal)\ngroups <- vapply(0:1,function(g) sum(complaint==g),numeric(1))\ncounts <- vapply(0:1,function(g) sum(complaint==g & churn==1),numeric(1))\ndenominators <- if(\"count\"==\"count\") c(NA_real_,NA_real_) else if(\"count\"==\"withinComplaint\") groups else if(\"count\"==\"amongChurn\") rep(sum(counts),2) else rep(nrow(rows),2)\nratios <- counts/denominators\nheights <- if(\"count\"==\"count\") counts else 100*ratios\npositions <- barplot(heights,names.arg=c(\"No complaint\",\"Complaint\"),ylim=c(0,max(heights)*1.22),ylab=\"Churn records (count)\",col=c(\"#347c93\",\"#ba673b\"),main=\"Actual retained customer records\")\nlabels <- if(\"count\"==\"count\") as.character(counts) else paste(counts,denominators,sep=\"/\")\ntext(positions,heights,labels=labels,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),complaintCodes=as.list(0:1),churnCounts=as.list(counts),groupCounts=as.list(groups),allChurn=sum(counts),mode=\"count\",denominators=as.list(denominators),ratios=as.list(ratios),plotHeights=as.list(heights),heightsArePercent=\"count\"!=\"count\",causalEffectIdentified=FALSE))\n",
        "codeFile": "data07-snippets/r/denominator-count.R",
        "codeSha256": "6e8a7f7d7e1848ddcc20fa5059e5c557f8e009ea78b07916ce62c456d8ad8b11",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-count-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "count",
          "denominators": [
            null,
            null
          ],
          "ratios": [
            null,
            null
          ],
          "plotHeights": [
            295,
            200
          ],
          "heightsArePercent": false,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-count-r.svg",
        "plotSha256": "269b55fb5adb30bbb90c7cc112f5ab295dd826cf4cb82542e56d5f54f0bdb4b3",
        "plotGeneratedBy": "base R svg",
        "mode": "count",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "withinComplaint": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3150,\"complaintCodes\":[0,1],\"churnCounts\":[295,200],\"groupCounts\":[2909,241],\"allChurn\":495,\"mode\":\"withinComplaint\",\"denominators\":[2909,241],\"ratios\":[0.10140941904434514,0.82987551867219922],\"plotHeights\":[10.140941904434515,82.987551867219921],\"heightsArePercent\":true,\"causalEffectIdentified\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "withinComplaint",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\ncomplaint <- as.numeric(rows$complaint_code_source_decimal)\nchurn <- as.numeric(rows$churn_code_source_decimal)\ngroups <- vapply(0:1,function(g) sum(complaint==g),numeric(1))\ncounts <- vapply(0:1,function(g) sum(complaint==g & churn==1),numeric(1))\ndenominators <- if(\"withinComplaint\"==\"count\") c(NA_real_,NA_real_) else if(\"withinComplaint\"==\"withinComplaint\") groups else if(\"withinComplaint\"==\"amongChurn\") rep(sum(counts),2) else rep(nrow(rows),2)\nratios <- counts/denominators\nheights <- if(\"withinComplaint\"==\"count\") counts else 100*ratios\npositions <- barplot(heights,names.arg=c(\"No complaint\",\"Complaint\"),ylim=c(0,max(heights)*1.22),ylab=\"Churn / complaint group (%)\",col=c(\"#347c93\",\"#ba673b\"),main=\"Actual retained customer records\")\nlabels <- if(\"withinComplaint\"==\"count\") as.character(counts) else paste(counts,denominators,sep=\"/\")\ntext(positions,heights,labels=labels,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),complaintCodes=as.list(0:1),churnCounts=as.list(counts),groupCounts=as.list(groups),allChurn=sum(counts),mode=\"withinComplaint\",denominators=as.list(denominators),ratios=as.list(ratios),plotHeights=as.list(heights),heightsArePercent=\"withinComplaint\"!=\"count\",causalEffectIdentified=FALSE))\n",
        "codeFile": "data07-snippets/r/denominator-withinComplaint.R",
        "codeSha256": "eebc13b74b72ceaaf4fb1b86e5ab633b468284487ab021b02ebf75ef5d320adf",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-withinComplaint-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "withinComplaint",
          "denominators": [
            2909,
            241
          ],
          "ratios": [
            0.10140941904434514,
            0.8298755186721992
          ],
          "plotHeights": [
            10.140941904434515,
            82.98755186721992
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-withinComplaint-r.svg",
        "plotSha256": "51dc293067eeb480bb000d8342b9f8ecdb82faab23aeee4f73d9c0f65c898245",
        "plotGeneratedBy": "base R svg",
        "mode": "withinComplaint",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "amongChurn": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3150,\"complaintCodes\":[0,1],\"churnCounts\":[295,200],\"groupCounts\":[2909,241],\"allChurn\":495,\"mode\":\"amongChurn\",\"denominators\":[495,495],\"ratios\":[0.59595959595959591,0.40404040404040403],\"plotHeights\":[59.595959595959592,40.404040404040401],\"heightsArePercent\":true,\"causalEffectIdentified\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "amongChurn",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\ncomplaint <- as.numeric(rows$complaint_code_source_decimal)\nchurn <- as.numeric(rows$churn_code_source_decimal)\ngroups <- vapply(0:1,function(g) sum(complaint==g),numeric(1))\ncounts <- vapply(0:1,function(g) sum(complaint==g & churn==1),numeric(1))\ndenominators <- if(\"amongChurn\"==\"count\") c(NA_real_,NA_real_) else if(\"amongChurn\"==\"withinComplaint\") groups else if(\"amongChurn\"==\"amongChurn\") rep(sum(counts),2) else rep(nrow(rows),2)\nratios <- counts/denominators\nheights <- if(\"amongChurn\"==\"count\") counts else 100*ratios\npositions <- barplot(heights,names.arg=c(\"No complaint\",\"Complaint\"),ylim=c(0,max(heights)*1.22),ylab=\"Complaint group / all churn (%)\",col=c(\"#347c93\",\"#ba673b\"),main=\"Actual retained customer records\")\nlabels <- if(\"amongChurn\"==\"count\") as.character(counts) else paste(counts,denominators,sep=\"/\")\ntext(positions,heights,labels=labels,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),complaintCodes=as.list(0:1),churnCounts=as.list(counts),groupCounts=as.list(groups),allChurn=sum(counts),mode=\"amongChurn\",denominators=as.list(denominators),ratios=as.list(ratios),plotHeights=as.list(heights),heightsArePercent=\"amongChurn\"!=\"count\",causalEffectIdentified=FALSE))\n",
        "codeFile": "data07-snippets/r/denominator-amongChurn.R",
        "codeSha256": "da5ebfef585390302131daa4d60a0b1d3747bf953873e50f1f4811e9015cb2b8",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-amongChurn-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "amongChurn",
          "denominators": [
            495,
            495
          ],
          "ratios": [
            0.5959595959595959,
            0.40404040404040403
          ],
          "plotHeights": [
            59.59595959595959,
            40.4040404040404
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-amongChurn-r.svg",
        "plotSha256": "814fc2167d1afc1d7c5dc52eba4ccf4ef67e09306ba69e1a0da50f486ddf185d",
        "plotGeneratedBy": "base R svg",
        "mode": "amongChurn",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      },
      "joint": {
        "returnCode": 0,
        "stdout": "{\"sourceCount\":3150,\"complaintCodes\":[0,1],\"churnCounts\":[295,200],\"groupCounts\":[2909,241],\"allChurn\":495,\"mode\":\"joint\",\"denominators\":[3150,3150],\"ratios\":[0.093650793650793651,0.063492063492063489],\"plotHeights\":[9.3650793650793656,6.3492063492063489],\"heightsArePercent\":true,\"causalEffectIdentified\":false}\n",
        "stderr": "During startup - Warning messages:\n1: Setting LC_COLLATE=C.UTF-8 failed \n2: Setting LC_CTYPE=C.UTF-8 failed \n3: Setting LC_MONETARY=C.UTF-8 failed \n4: Setting LC_TIME=C.UTF-8 failed \n",
        "language": "r",
        "id": "joint",
        "code": "if (.Platform$OS.type == \"windows\") invisible(Sys.setlocale(\"LC_CTYPE\", \"English_United States.utf8\"))\nto_json <- function(x) {\n  if (is.null(x)) return(\"null\")\n  if (is.list(x)) {\n    parts <- vapply(x,to_json,character(1))\n    if (is.null(names(x))) return(paste0(\"[\",paste(parts,collapse=\",\"),\"]\"))\n    keys <- vapply(names(x),function(s) encodeString(s,quote='\"'),character(1))\n    return(paste0(\"{\",paste(paste0(keys,\":\",parts),collapse=\",\"),\"}\"))\n  }\n  if (length(x)!=1L) return(to_json(as.list(x)))\n  if (is.na(x)) return(\"null\")\n  if (is.character(x)) return(encodeString(x,quote='\"'))\n  if (is.logical(x)) return(tolower(as.character(x)))\n  if (!is.finite(x)) stop(\"finite JSON display required\")\n  format(x,digits=17,scientific=FALSE,trim=TRUE)\n}\nemit <- function(x) cat(to_json(x),\"\\n\",sep=\"\")\nload_csv <- function(path) read.csv(path,check.names=FALSE,colClasses=\"character\",na.strings=character(),stringsAsFactors=FALSE)\nargs <- commandArgs(trailingOnly=TRUE)\nsvg(args[2],width=8,height=4.6,family=\"sans\",onefile=TRUE)\npar(mar=c(4.7,4.8,3.3,1.2),las=1,cex=.9)\nrows <- load_csv(args[1])\ncomplaint <- as.numeric(rows$complaint_code_source_decimal)\nchurn <- as.numeric(rows$churn_code_source_decimal)\ngroups <- vapply(0:1,function(g) sum(complaint==g),numeric(1))\ncounts <- vapply(0:1,function(g) sum(complaint==g & churn==1),numeric(1))\ndenominators <- if(\"joint\"==\"count\") c(NA_real_,NA_real_) else if(\"joint\"==\"withinComplaint\") groups else if(\"joint\"==\"amongChurn\") rep(sum(counts),2) else rep(nrow(rows),2)\nratios <- counts/denominators\nheights <- if(\"joint\"==\"count\") counts else 100*ratios\npositions <- barplot(heights,names.arg=c(\"No complaint\",\"Complaint\"),ylim=c(0,max(heights)*1.22),ylab=\"Group and churn / all records (%)\",col=c(\"#347c93\",\"#ba673b\"),main=\"Actual retained customer records\")\nlabels <- if(\"joint\"==\"count\") as.character(counts) else paste(counts,denominators,sep=\"/\")\ntext(positions,heights,labels=labels,pos=3,cex=.85)\ninvisible(dev.off())\nemit(list(sourceCount=nrow(rows),complaintCodes=as.list(0:1),churnCounts=as.list(counts),groupCounts=as.list(groups),allChurn=sum(counts),mode=\"joint\",denominators=as.list(denominators),ratios=as.list(ratios),plotHeights=as.list(heights),heightsArePercent=\"joint\"!=\"count\",causalEffectIdentified=FALSE))\n",
        "codeFile": "data07-snippets/r/denominator-joint.R",
        "codeSha256": "0d90a69c20ae165be92ef5b128238d39016e11c82531dba6eed2084788909c44",
        "inputFile": "data07-sources/actual3150-customer-complaint-and-churn-source-codes.csv",
        "inputSha256": "f9d64252d938c8948aaafc5ddde38d252b3142b6f19d4687f296cd5295807447",
        "arguments": [
          "data07-sources\\actual3150-customer-complaint-and-churn-source-codes.csv",
          "data07-plots\\denominator-joint-r.svg"
        ],
        "recordedActualProcess": true,
        "browserExecutesLanguage": false,
        "originalSourceModified": false,
        "summary": {
          "sourceCount": 3150,
          "complaintCodes": [
            0,
            1
          ],
          "churnCounts": [
            295,
            200
          ],
          "groupCounts": [
            2909,
            241
          ],
          "allChurn": 495,
          "mode": "joint",
          "denominators": [
            3150,
            3150
          ],
          "ratios": [
            0.09365079365079365,
            0.06349206349206349
          ],
          "plotHeights": [
            9.365079365079366,
            6.349206349206349
          ],
          "heightsArePercent": true,
          "causalEffectIdentified": false
        },
        "plotFile": "data07-plots/denominator-joint-r.svg",
        "plotSha256": "d5ae7be6fa63068e8d36a0386754585f4f1ab14de21a493af4a9014c00df9113",
        "plotGeneratedBy": "base R svg",
        "mode": "joint",
        "plotReading": "The explicit denominator determines the event being summarized; counts, group rates, churn composition and joint shares are distinct."
      }
    }
  },
  "actualTeachingProcessCounts": {
    "audit": 4,
    "histogram": 8,
    "axis": 4,
    "target": 4,
    "denominator": 8,
    "total": 28
  },
  "actualPlotCount": 24,
  "artifactManifest": [
    {
      "file": "data07-snippets/python/audit-person.py",
      "sha256": "8c77223f7d7d23fc29655ac54551c9c3910e7b2cf254db7141b1e2fdad5800a9",
      "bytes": 1158
    },
    {
      "file": "data07-snippets/python/audit-toy.py",
      "sha256": "f5de545b345e08cad052ce7680543bf82a76dcdc5a8cd760751c765d5fa94958",
      "bytes": 684
    },
    {
      "file": "data07-snippets/python/axis-zero.py",
      "sha256": "76cce1c3f22d384fce3ce9ce2be266108ad2b7c88e9b5551ebb5e7ed1a85b261",
      "bytes": 1331
    },
    {
      "file": "data07-snippets/python/axis-zoom.py",
      "sha256": "7230de64e4a831d6bc454848c46a731d156d2be7a77343ab8fdb1970b7fb812e",
      "bytes": 1333
    },
    {
      "file": "data07-snippets/python/denominator-amongChurn.py",
      "sha256": "bd6417ffb0612a0c5534b819dfa928a2fd7dea675c9b6193175a09a6a7500bec",
      "bytes": 2093
    },
    {
      "file": "data07-snippets/python/denominator-count.py",
      "sha256": "b0af41751da03698491bc58c16ee5a879be60df7de5cdd3c869facb1b8f6aba8",
      "bytes": 2048
    },
    {
      "file": "data07-snippets/python/denominator-joint.py",
      "sha256": "b3fdbb290483ba1b871a76625275ad48a769cee409ba74f64d8a5ce7ff463fdb",
      "bytes": 2060
    },
    {
      "file": "data07-snippets/python/denominator-withinComplaint.py",
      "sha256": "bed39f199972aa7e8204d12f2b526c97f4190aa8177b14a9fd6e7a66ab06e163",
      "bytes": 2124
    },
    {
      "file": "data07-snippets/python/histogram-equal-cents.py",
      "sha256": "ec890173ee903493c2709bdbc4101b4c11a6d723927c2c3a79ecdb629ae31fe5",
      "bytes": 2161
    },
    {
      "file": "data07-snippets/python/histogram-equal-usd.py",
      "sha256": "81df0002d539b4e0976d682648b6c0d630a77473efb5750a7c001b6a754aa38e",
      "bytes": 2147
    },
    {
      "file": "data07-snippets/python/histogram-unequal-cents.py",
      "sha256": "187183b54ad4d55f013bf37e73d8b583a0854b628db674e31efcc76dc15d2151",
      "bytes": 2159
    },
    {
      "file": "data07-snippets/python/histogram-unequal-usd.py",
      "sha256": "866080ead0614d158616d01fc1458500c69680b6b25fb06a760b62b8659afffc",
      "bytes": 2145
    },
    {
      "file": "data07-snippets/python/target-population.py",
      "sha256": "078d39e7ad0af8d188d405f9011ac3c80bae763eb03ab03f56a21cd16f89fdd8",
      "bytes": 1850
    },
    {
      "file": "data07-snippets/python/target-uniform.py",
      "sha256": "7636293e0e30d821e75fa4e47b0c17810b94de68ce2e9aaffe3efaaa3ece55a8",
      "bytes": 1841
    },
    {
      "file": "data07-snippets/r/audit-person.R",
      "sha256": "ff60b02c7edd2032ada4f8ea71f91ef323c75149262c1f4594e094355d91321b",
      "bytes": 1695
    },
    {
      "file": "data07-snippets/r/audit-toy.R",
      "sha256": "6ec1e16e71c8002dc6199d3dbb0ad62768d745ee1174bdd5175e70f6eac35cf2",
      "bytes": 1322
    },
    {
      "file": "data07-snippets/r/axis-zero.R",
      "sha256": "de2939e3e3dd88c07ca7ffdda0f52ba08a1833df2b14ef89d9f8b7c74deb298d",
      "bytes": 1706
    },
    {
      "file": "data07-snippets/r/axis-zoom.R",
      "sha256": "2ab4c716b4d1a4552a89d225e6a83ac4b9abc1fb611c94595a6bdc42c43f92a9",
      "bytes": 1708
    },
    {
      "file": "data07-snippets/r/denominator-amongChurn.R",
      "sha256": "da5ebfef585390302131daa4d60a0b1d3747bf953873e50f1f4811e9015cb2b8",
      "bytes": 2315
    },
    {
      "file": "data07-snippets/r/denominator-count.R",
      "sha256": "6e8a7f7d7e1848ddcc20fa5059e5c557f8e009ea78b07916ce62c456d8ad8b11",
      "bytes": 2270
    },
    {
      "file": "data07-snippets/r/denominator-joint.R",
      "sha256": "0d90a69c20ae165be92ef5b128238d39016e11c82531dba6eed2084788909c44",
      "bytes": 2282
    },
    {
      "file": "data07-snippets/r/denominator-withinComplaint.R",
      "sha256": "eebc13b74b72ceaaf4fb1b86e5ab633b468284487ab021b02ebf75ef5d320adf",
      "bytes": 2346
    },
    {
      "file": "data07-snippets/r/histogram-equal-cents.R",
      "sha256": "b3d0a387448d17fdcf8c3bbe1b0350ced247f5f6c20f338b27a87f8e76350aeb",
      "bytes": 2361
    },
    {
      "file": "data07-snippets/r/histogram-equal-usd.R",
      "sha256": "0a79fd2bdf11a2f92843393ac729e410ede78636bbc1ab017750aa7807201ad6",
      "bytes": 2347
    },
    {
      "file": "data07-snippets/r/histogram-unequal-cents.R",
      "sha256": "cf6bb20ab33429edcb192b19395f44a2caed93710e6cb32dd1077514efae81c9",
      "bytes": 2359
    },
    {
      "file": "data07-snippets/r/histogram-unequal-usd.R",
      "sha256": "a81b55cddf30f820dafe7a4fe285c2cf4074a031c0143295ea4cd218404b8d0e",
      "bytes": 2345
    },
    {
      "file": "data07-snippets/r/target-population.R",
      "sha256": "f99db1c6833ed367ede5c17dbcfda4fca8227f25fb7912f2166c04b0a76233ed",
      "bytes": 2098
    },
    {
      "file": "data07-snippets/r/target-uniform.R",
      "sha256": "2a9b66c4c3afbb4b6b530efc9b16d608dcf9d1d97418435bef3c4e691082a165",
      "bytes": 2089
    },
    {
      "file": "data07-plots/axis-zero-python.svg",
      "sha256": "885ddff1f8d9f89e5c3b53eb3d264c836d5f1fefcc0557b0f3976b19aea7e497",
      "bytes": 6818
    },
    {
      "file": "data07-plots/axis-zero-r.svg",
      "sha256": "4cc1850fb46ab8571535a39d407c30cf8ae60c02c28709eaa3d36241b7daffb7",
      "bytes": 45115
    },
    {
      "file": "data07-plots/axis-zoom-python.svg",
      "sha256": "2850012bec7f77a0d4b11ca9c8661600d219de74fdbee07a40215be243e179c4",
      "bytes": 7611
    },
    {
      "file": "data07-plots/axis-zoom-r.svg",
      "sha256": "ba38f107f89462d37818c366223c878b8279d7c651c8d1dac50a182d34e4d31b",
      "bytes": 45948
    },
    {
      "file": "data07-plots/denominator-amongChurn-python.svg",
      "sha256": "62eea1db75cc951692ba7d5df1a9aaad9588a3e1e60282f5b6238240a298a49e",
      "bytes": 7647
    },
    {
      "file": "data07-plots/denominator-amongChurn-r.svg",
      "sha256": "814fc2167d1afc1d7c5dc52eba4ccf4ef67e09306ba69e1a0da50f486ddf185d",
      "bytes": 64558
    },
    {
      "file": "data07-plots/denominator-count-python.svg",
      "sha256": "3824cccffcd5c0797c2d1e05e79a23df3623271957d7b1a9128f7e30442e6e37",
      "bytes": 7637
    },
    {
      "file": "data07-plots/denominator-count-r.svg",
      "sha256": "269b55fb5adb30bbb90c7cc112f5ab295dd826cf4cb82542e56d5f54f0bdb4b3",
      "bytes": 56263
    },
    {
      "file": "data07-plots/denominator-joint-python.svg",
      "sha256": "1924cbb33373545cca13ea186943117065a8d44d6454d8641fedcd39bdcd1a0a",
      "bytes": 6867
    },
    {
      "file": "data07-plots/denominator-joint-r.svg",
      "sha256": "d5ae7be6fa63068e8d36a0386754585f4f1ab14de21a493af4a9014c00df9113",
      "bytes": 64899
    },
    {
      "file": "data07-plots/denominator-withinComplaint-python.svg",
      "sha256": "108608cdb61e866f092ac3ade1ee59e147b119b7d09617f541d1e3a23d5bd5c5",
      "bytes": 6866
    },
    {
      "file": "data07-plots/denominator-withinComplaint-r.svg",
      "sha256": "51dc293067eeb480bb000d8342b9f8ecdb82faab23aeee4f73d9c0f65c898245",
      "bytes": 62765
    },
    {
      "file": "data07-plots/histogram-equal-cents-python.svg",
      "sha256": "7516f9b2b09617fee67cd163871083925cd106ccfa3bf326ff190a40a03ef383",
      "bytes": 10256
    },
    {
      "file": "data07-plots/histogram-equal-cents-r.svg",
      "sha256": "2b63378e6eb1a4cba3ecf48e93f90512b3d93096fe6b3a79301dd3cdf1af2f84",
      "bytes": 75258
    },
    {
      "file": "data07-plots/histogram-equal-usd-python.svg",
      "sha256": "ae29471217d27bc1851b5602dfee1e9743474a7c5ae801cb4e86e6bbc6e3a56c",
      "bytes": 10209
    },
    {
      "file": "data07-plots/histogram-equal-usd-r.svg",
      "sha256": "7499fbbc28dde00c2ac9354e91e5a4fcfc559272f39ab5a786240566f1135e9c",
      "bytes": 71990
    },
    {
      "file": "data07-plots/histogram-unequal-cents-python.svg",
      "sha256": "2e44a14473b9bd91e1454dfb27d188f88561eda79957dd34a55f3e8e5ff21161",
      "bytes": 11086
    },
    {
      "file": "data07-plots/histogram-unequal-cents-r.svg",
      "sha256": "0f7848040041b3aaaf2543507f2ac1fbdb8fb5dcd738e1918ad4cbc4a33bb18a",
      "bytes": 75956
    },
    {
      "file": "data07-plots/histogram-unequal-usd-python.svg",
      "sha256": "42cc13d6701387d97b2b873bccc5ebb8ef69ecefaa71a06119f4b2b28944cb8a",
      "bytes": 11018
    },
    {
      "file": "data07-plots/histogram-unequal-usd-r.svg",
      "sha256": "c19cc131750f085655f1120b1e9d4d286906634b879c5896c8c34c37264daa0a",
      "bytes": 73033
    },
    {
      "file": "data07-plots/target-population-python.svg",
      "sha256": "f43176bb370e8647a3603b765096a7563fc01ddd8871a2e95662187e56051307",
      "bytes": 15537
    },
    {
      "file": "data07-plots/target-population-r.svg",
      "sha256": "7bba5cdbba2bdee18c884e67dcc9b30164a7271273ceaf5b4e7d034f9ddbaebf",
      "bytes": 102244
    },
    {
      "file": "data07-plots/target-uniform-python.svg",
      "sha256": "6c100f23b2c4e334dc309d9f00acd986f970f35b225d0ab53ed57f9f1f1fcf97",
      "bytes": 15534
    },
    {
      "file": "data07-plots/target-uniform-r.svg",
      "sha256": "97f198fa4fede6fabf8c54ea764d3548a96a37c86db0568e6efcf118c66efce7",
      "bytes": 102986
    }
  ]
,
"publicationProjection":{"kind": "recorded-source-and-execution-path-omission", "originalFileSHA256": "bfb13513f175f4b79634d86428d0f86868ebb1e9c65718209bfe76e2a84e657a", "changedStringFields": 2, "note": {"ko": "원자료·실행 기록의 시스템별 경로를 생략했습니다. 보관 원본·코드·자료·종료 상태·수치는 유지합니다. 이 경로 표시는 새로 실행한 명령을 뜻하지 않습니다.", "en": "System-specific paths in source and execution metadata are omitted. Archived originals, code, data, return status and numerical values are preserved. These path labels do not claim a new or differently executed command."}}}