Advertisement
raba93

Untitled

Jan 10th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 4.32 KB | None | 0 0
  1. {
  2.   "kind": "datagator#Recipe",
  3.   "context": {
  4.     "kind": "datagator#Recipe#context",
  5.     "items": [
  6.       {
  7.         "kind": "datagator#Recipe#load",
  8.         "from": {
  9.           "$ref": "#/routine/xcf841de99086159886e85c0"
  10.         },
  11.         "as": "M"
  12.       }
  13.     ],
  14.     "itemsCount": 1
  15.   },
  16.   "process": {
  17.     "kind": "datagator#Recipe#process",
  18.     "items": [
  19.       {
  20.         "kind": "datagator#Recipe#comment",
  21.         "text": "# nodeType=dyad"
  22.       },
  23.       {
  24.         "kind": "datagator#Recipe#comment",
  25.         "text": "# name=Convert to Dyad"
  26.       },
  27.       {
  28.         "kind": "datagator#Recipe#comment",
  29.         "text": "# description=Convert a Data Table from a monadic data table (one unit of analysis) to a dyadic Data Table (two units of analysis) using a specified unit of analysis and method of aggregation (count/sum/average) for the pairs. Users can also choose a 'subject' which the dyad shares."
  30.       },
  31.       {
  32.         "kind": "datagator#Recipe#comment",
  33.         "text": "# operation=product"
  34.       },
  35.       {
  36.         "kind": "datagator#Recipe#comment",
  37.         "text": "# dropNull=true"
  38.       },
  39.       {
  40.         "expr": "\"a\", \"abc\", \"Country\", M.columnHeaders.body.rows[0]",
  41.         "kind": "datagator#Recipe#yield"
  42.       },
  43.       {
  44.         "by": "\"a\", \"Country\"",
  45.         "kind": "datagator#Recipe#index",
  46.         "on": "M"
  47.       },
  48.       {
  49.         "kind": "datagator#Recipe#assign",
  50.         "to": "Product",
  51.         "expr": "Transform(\"x[0] * x[1]\", \"x\")"
  52.       },
  53.       {
  54.         "cursor": "key_A, key_B",
  55.         "in": "Product(M, M)",
  56.         "items": [
  57.           {
  58.             "expr": "key_A[0], Slice(key_A, 1, NULL)",
  59.             "kind": "datagator#Recipe#assign",
  60.             "to": "name_A, subject"
  61.           },
  62.           {
  63.             "expr": "key_B[0], Slice(key_B, 1, NULL)",
  64.             "kind": "datagator#Recipe#assign",
  65.             "to": "name_B, subject_B"
  66.           },
  67.           {
  68.             "cond": "name_A == name_B or subject != subject_B",
  69.             "items": [
  70.               {
  71.                 "kind": "datagator#Recipe#continue"
  72.               }
  73.             ],
  74.             "itemsCount": 1,
  75.             "kind": "datagator#Recipe#if"
  76.           },
  77.           {
  78.             "kind": "datagator#Recipe#assign",
  79.             "to": "data_A",
  80.             "expr": "Average(M[key_A].body)"
  81.           },
  82.           {
  83.             "kind": "datagator#Recipe#assign",
  84.             "to": "data_B",
  85.             "expr": "Average(M[key_B].body)"
  86.           },
  87.           {
  88.             "kind": "datagator#Recipe#assign",
  89.             "to": "metrics",
  90.             "expr": "Stack(data_A, data_B)"
  91.           },
  92.           {
  93.             "kind": "datagator#Recipe#assign",
  94.             "to": "nilmask",
  95.             "expr": "(Count(metrics) < 2)"
  96.           },
  97.           {
  98.             "expr": "Product(metrics)",
  99.             "kind": "datagator#Recipe#assign",
  100.             "to": "result"
  101.           },
  102.           {
  103.             "kind": "datagator#Recipe#assign",
  104.             "to": "result[nilmask]",
  105.             "expr": "NULL"
  106.           },
  107.           {
  108.             "cond": "not Any(result)",
  109.             "items": [
  110.               {
  111.                 "kind": "datagator#Recipe#continue"
  112.               }
  113.             ],
  114.             "itemsCount": 1,
  115.             "kind": "datagator#Recipe#if"
  116.           },
  117.           {
  118.             "expr": "name_A, name_B, subject, result",
  119.             "kind": "datagator#Recipe#yield"
  120.           }
  121.         ],
  122.         "itemsCount": 11,
  123.         "kind": "datagator#Recipe#for"
  124.       },
  125.       {
  126.         "columnHeaders": 1,
  127.         "kind": "datagator#Recipe#layout",
  128.         "rowHeaders": 3
  129.       }
  130.     ],
  131.     "itemsCount": 10
  132.   },
  133.   "routine": {
  134.     "xcf841de99086159886e85c0": {
  135.       "context": {
  136.         "items": [],
  137.         "itemsCount": 0,
  138.         "kind": "datagator#Recipe#context"
  139.       },
  140.       "kind": "datagator#Recipe",
  141.       "process": {
  142.         "items": [
  143.           {
  144.             "expr": "\"Country\",\"a\",1990,1989,1991,1992",
  145.             "kind": "datagator#Recipe#yield"
  146.           },
  147.           {
  148.             "columnHeaders": 1,
  149.             "kind": "datagator#Recipe#layout",
  150.             "rowHeaders": 2
  151.           }
  152.         ],
  153.         "itemsCount": 2,
  154.         "kind": "datagator#Recipe#process"
  155.       }
  156.     }
  157.   }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement