tests/testthat/_snaps/complexswitch.md

Default behavior works

{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["pc", "mrt", "switch_cost_pc", "switch_cost_mrt", "switch_cost_ies", "switch_cost_rcs", "switch_cost_lisas", "pc_switch", "pc_repeat", "mrt_switch", "mrt_repeat", "ies_switch", "ies_repeat", "rcs_switch", "rcs_repeat", "lisas_switch", "lisas_repeat", "cong_eff_pc", "cong_eff_mrt", "cong_eff_ies", "cong_eff_rcs", "cong_eff_lisas", "pc_inc", "pc_con", "mrt_inc", "mrt_con", "ies_inc", "ies_con", "rcs_inc", "rcs_con", "lisas_inc", "lisas_con"]
    },
    "row.names": {
      "type": "integer",
      "attributes": {},
      "value": [1]
    },
    "class": {
      "type": "character",
      "attributes": {},
      "value": ["tbl_df", "tbl", "data.frame"]
    }
  },
  "value": [
    {
      "type": "double",
      "attributes": {},
      "value": [0.40540541]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.11061281]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.00318979]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.03673245]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.10672212]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.04541412]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [-0.10625807]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42105263]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42424242]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.12775462]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.09102217]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.67841722]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.5716951]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42653224]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.47194636]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.19142257]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.29768064]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.15147059]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32142707]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.97200797]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.22222221]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.78009749]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32352941]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.475]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.31418328]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.99275622]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [4.06202106]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.09001309]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32997439]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.5521966]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.75516659]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.97506911]
    }
  ]
}

Works with grouping variable

{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["id", "pc", "mrt", "switch_cost_pc", "switch_cost_mrt", "switch_cost_ies", "switch_cost_rcs", "switch_cost_lisas", "pc_switch", "pc_repeat", "mrt_switch", "mrt_repeat", "ies_switch", "ies_repeat", "rcs_switch", "rcs_repeat", "lisas_switch", "lisas_repeat", "cong_eff_pc", "cong_eff_mrt", "cong_eff_ies", "cong_eff_rcs", "cong_eff_lisas", "pc_inc", "pc_con", "mrt_inc", "mrt_con", "ies_inc", "ies_con", "rcs_inc", "rcs_con", "lisas_inc", "lisas_con"]
    },
    "row.names": {
      "type": "integer",
      "attributes": {},
      "value": [1, 2]
    },
    "class": {
      "type": "character",
      "attributes": {},
      "value": ["tbl_df", "tbl", "data.frame"]
    }
  },
  "value": [
    {
      "type": "integer",
      "attributes": {},
      "value": [1, 2]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.40540541, 0.41489362]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.11061281, 0.89531704]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.00318979, -0.09558824]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.03673245, -0.45252395]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.10672212, -1.56451712]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.04541412, -0.16820346]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [-0.10625807, -0.80703719]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42105263, 0.47058824]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42424242, 0.375]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.12775462, 0.66052909]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.09102217, 1.11305303]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.67841722, 1.40362431]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.5716951, 2.96814142]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.42653224, 0.57441948]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.47194636, 0.40621602]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.19142257, 1.42115896]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.29768064, 2.22819615]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.15147059, 0.09931973]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32142707, -0.34011295]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.97200797, -0.31620165]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.22222221, 0.04207083]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.78009749, -0.73362084]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32352941, 0.36734694]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.475, 0.46666667]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.31418328, 0.71217929]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.99275622, 1.05229224]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [4.06202106, 1.9387103]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.09001309, 2.25491195]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.32997439, 0.47614418]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.5521966, 0.51821501]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [2.75516659, 1.3738003]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.97506911, 2.10742114]
    }
  ]
}

Works when condition missing

{
  "type": "list",
  "attributes": {
    "class": {
      "type": "character",
      "attributes": {},
      "value": ["tbl_df", "tbl", "data.frame"]
    },
    "row.names": {
      "type": "integer",
      "attributes": {},
      "value": [1]
    },
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["pc", "mrt", "switch_cost_pc", "switch_cost_mrt", "switch_cost_ies", "switch_cost_rcs", "switch_cost_lisas", "pc_switch", "pc_repeat", "mrt_switch", "mrt_repeat", "ies_switch", "ies_repeat", "rcs_switch", "rcs_repeat", "lisas_switch", "lisas_repeat", "cong_eff_pc", "cong_eff_mrt", "cong_eff_ies", "cong_eff_rcs", "cong_eff_lisas", "pc_inc", "pc_con", "mrt_inc", "mrt_con", "ies_inc", "ies_con", "rcs_inc", "rcs_con", "lisas_inc", "lisas_con"]
    }
  },
  "value": [
    {
      "type": "double",
      "attributes": {},
      "value": [0.525]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.98830673]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.525]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.98830673]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.88248901]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.5520562]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.70138519]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.525]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.98830673]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.88248901]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.5520562]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [1.70138519]
    },
    {
      "type": "double",
      "attributes": {},
      "value": ["NA"]
    }
  ]
}


psychelzh/dataproc.iquizoo documentation built on April 11, 2024, 6:02 p.m.