tests/testthat/_snaps/lifetable_corrected.md

lt.correction failes for wrong input

x is not an object of class mortaar_life_table or mortaar_life_table_list.

lt.correction produces the right output

{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["indices", "life_table_corr"]
    }
  },
  "value": [
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["method", "value", "range_start", "range_end"]
        },
        "row.names": {
          "type": "integer",
          "attributes": {},
          "value": [1, 2, 3]
        },
        "class": {
          "type": "character",
          "attributes": {},
          "value": ["data.frame"]
        }
      },
      "value": [
        {
          "type": "character",
          "attributes": {},
          "value": ["e0", "1q0", "5q0"]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [22.549, 0.29, 0.465]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [21.046, 0.274, 0.424]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [24.052, 0.306, 0.506]
        }
      ]
    },
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["x", "a", "Ax", "Dx", "dx", "lx", "qx", "Lx", "Tx", "ex", "rel_popx"]
        },
        "row.names": {
          "type": "integer",
          "attributes": {},
          "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
        },
        "class": {
          "type": "character",
          "attributes": {},
          "value": ["mortaar_life_table", "tbl_df", "tbl", "data.frame"]
        }
      },
      "value": [
        {
          "type": "character",
          "attributes": {},
          "value": ["0--4", "5--9", "10--14", "15--19", "20--26", "27--33", "34--40", "41--47", "48--54", "55--61", "62--68"]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [1.66667, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [171.10163, 22, 12, 8, 15, 30, 12, 19, 36, 28, 15]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [46.48217, 5.97661, 3.25997, 2.17331, 4.07496, 8.14992, 3.25997, 5.16162, 9.77991, 7.60659, 4.07496]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [100, 53.51783, 47.54122, 44.28125, 42.10794, 38.03297, 29.88305, 26.62308, 21.46146, 11.68156, 4.07496]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [46.48217, 11.16751, 6.85714, 4.90798, 9.67742, 21.42857, 10.90909, 19.38776, 45.56962, 65.11628, 100]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [345.05943, 252.64762, 229.55617, 215.97296, 280.49319, 237.70609, 197.77147, 168.29591, 116.00057, 55.14781, 14.26237]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [2112.91358, 1767.85415, 1515.20653, 1285.65037, 1069.67741, 789.18422, 551.47813, 353.70666, 185.41075, 69.41018, 14.26237]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [21.12914, 33.03299, 31.87143, 29.03374, 25.40323, 20.75, 18.45455, 13.28571, 8.63924, 5.94186, 3.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [16.33098, 11.95731, 10.86444, 10.22157, 13.27518, 11.25016, 9.36013, 7.96511, 5.49008, 2.61004, 0.67501]
        }
      ]
    }
  ]
}
{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["indices", "life_table_corr"]
    }
  },
  "value": [
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["method", "value", "range_start", "range_end"]
        },
        "row.names": {
          "type": "integer",
          "attributes": {},
          "value": [1, 2, 3]
        },
        "class": {
          "type": "character",
          "attributes": {},
          "value": ["data.frame"]
        }
      },
      "value": [
        {
          "type": "character",
          "attributes": {},
          "value": ["e0", "1q0", "5q0"]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [22.549, 0.29, 0.465]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [21.046, 0.274, 0.424]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [24.052, 0.306, 0.506]
        }
      ]
    },
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["x", "a", "Ax", "Dx", "dx", "lx", "qx", "Lx", "Tx", "ex", "rel_popx"]
        },
        "row.names": {
          "type": "integer",
          "attributes": {},
          "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
        },
        "class": {
          "type": "character",
          "attributes": {},
          "value": ["mortaar_life_table", "tbl_df", "tbl", "data.frame"]
        }
      },
      "value": [
        {
          "type": "character",
          "attributes": {},
          "value": ["0--4", "5--9", "10--14", "15--19", "20--26", "27--33", "34--40", "41--47", "48--54", "55--61", "62--68"]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [2.5, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [171.10163, 22, 12, 8, 15, 30, 12, 19, 36, 28, 15]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [46.48217, 5.97661, 3.25997, 2.17331, 4.07496, 8.14992, 3.25997, 5.16162, 9.77991, 7.60659, 4.07496]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [100, 53.51783, 47.54122, 44.28125, 42.10794, 38.03297, 29.88305, 26.62308, 21.46146, 11.68156, 4.07496]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [46.48217, 11.16751, 6.85714, 4.90798, 9.67742, 21.42857, 10.90909, 19.38776, 45.56962, 65.11628, 100]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [383.79457, 252.64762, 229.55617, 215.97296, 280.49319, 237.70609, 197.77147, 168.29591, 116.00057, 55.14781, 14.26237]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [2151.64872, 1767.85415, 1515.20653, 1285.65037, 1069.67741, 789.18422, 551.47813, 353.70666, 185.41075, 69.41018, 14.26237]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [21.51649, 33.03299, 31.87143, 29.03374, 25.40323, 20.75, 18.45455, 13.28571, 8.63924, 5.94186, 3.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [17.83723, 11.74205, 10.66885, 10.03756, 13.0362, 11.04763, 9.19162, 7.82172, 5.39124, 2.56305, 0.66286]
        }
      ]
    }
  ]
}
{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["sl1", "sl2"]
    }
  },
  "value": [
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["indices", "life_table_corr"]
        }
      },
      "value": [
        {
          "type": "list",
          "attributes": {
            "names": {
              "type": "character",
              "attributes": {},
              "value": ["method", "value", "range_start", "range_end"]
            },
            "row.names": {
              "type": "integer",
              "attributes": {},
              "value": [1, 2, 3]
            },
            "class": {
              "type": "character",
              "attributes": {},
              "value": ["data.frame"]
            }
          },
          "value": [
            {
              "type": "character",
              "attributes": {},
              "value": ["e0", "1q0", "5q0"]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [22.549, 0.29, 0.465]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [21.046, 0.274, 0.424]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [24.052, 0.306, 0.506]
            }
          ]
        },
        {
          "type": "list",
          "attributes": {
            "names": {
              "type": "character",
              "attributes": {},
              "value": ["x", "a", "Ax", "Dx", "dx", "lx", "qx", "Lx", "Tx", "ex", "rel_popx"]
            },
            "row.names": {
              "type": "integer",
              "attributes": {},
              "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
            },
            "class": {
              "type": "character",
              "attributes": {},
              "value": ["mortaar_life_table", "tbl_df", "tbl", "data.frame"]
            }
          },
          "value": [
            {
              "type": "character",
              "attributes": {},
              "value": ["0--4", "5--9", "10--14", "15--19", "20--26", "27--33", "34--40", "41--47", "48--54", "55--61", "62--68"]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [1.66667, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [171.10163, 22, 12, 8, 15, 30, 12, 19, 36, 28, 15]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [46.48217, 5.97661, 3.25997, 2.17331, 4.07496, 8.14992, 3.25997, 5.16162, 9.77991, 7.60659, 4.07496]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [100, 53.51783, 47.54122, 44.28125, 42.10794, 38.03297, 29.88305, 26.62308, 21.46146, 11.68156, 4.07496]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [46.48217, 11.16751, 6.85714, 4.90798, 9.67742, 21.42857, 10.90909, 19.38776, 45.56962, 65.11628, 100]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [345.05943, 252.64762, 229.55617, 215.97296, 280.49319, 237.70609, 197.77147, 168.29591, 116.00057, 55.14781, 14.26237]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [2112.91358, 1767.85415, 1515.20653, 1285.65037, 1069.67741, 789.18422, 551.47813, 353.70666, 185.41075, 69.41018, 14.26237]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [21.12914, 33.03299, 31.87143, 29.03374, 25.40323, 20.75, 18.45455, 13.28571, 8.63924, 5.94186, 3.5]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [16.33098, 11.95731, 10.86444, 10.22157, 13.27518, 11.25016, 9.36013, 7.96511, 5.49008, 2.61004, 0.67501]
            }
          ]
        }
      ]
    },
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["indices", "life_table_corr"]
        }
      },
      "value": [
        {
          "type": "list",
          "attributes": {
            "names": {
              "type": "character",
              "attributes": {},
              "value": ["method", "value", "range_start", "range_end"]
            },
            "row.names": {
              "type": "integer",
              "attributes": {},
              "value": [1, 2, 3]
            },
            "class": {
              "type": "character",
              "attributes": {},
              "value": ["data.frame"]
            }
          },
          "value": [
            {
              "type": "character",
              "attributes": {},
              "value": ["e0", "1q0", "5q0"]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [22.549, 0.29, 0.465]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [21.046, 0.274, 0.424]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [24.052, 0.306, 0.506]
            }
          ]
        },
        {
          "type": "list",
          "attributes": {
            "names": {
              "type": "character",
              "attributes": {},
              "value": ["x", "a", "Ax", "Dx", "dx", "lx", "qx", "Lx", "Tx", "ex", "rel_popx"]
            },
            "row.names": {
              "type": "integer",
              "attributes": {},
              "value": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
            },
            "class": {
              "type": "character",
              "attributes": {},
              "value": ["mortaar_life_table", "tbl_df", "tbl", "data.frame"]
            }
          },
          "value": [
            {
              "type": "character",
              "attributes": {},
              "value": ["0--4", "5--9", "10--14", "15--19", "20--26", "27--33", "34--40", "41--47", "48--54", "55--61", "62--68"]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [1.66667, 2.5, 2.5, 2.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5, 3.5]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [171.10163, 22, 12, 8, 15, 30, 12, 19, 36, 28, 15]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [46.48217, 5.97661, 3.25997, 2.17331, 4.07496, 8.14992, 3.25997, 5.16162, 9.77991, 7.60659, 4.07496]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [100, 53.51783, 47.54122, 44.28125, 42.10794, 38.03297, 29.88305, 26.62308, 21.46146, 11.68156, 4.07496]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [46.48217, 11.16751, 6.85714, 4.90798, 9.67742, 21.42857, 10.90909, 19.38776, 45.56962, 65.11628, 100]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [345.05943, 252.64762, 229.55617, 215.97296, 280.49319, 237.70609, 197.77147, 168.29591, 116.00057, 55.14781, 14.26237]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [2112.91358, 1767.85415, 1515.20653, 1285.65037, 1069.67741, 789.18422, 551.47813, 353.70666, 185.41075, 69.41018, 14.26237]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [21.12914, 33.03299, 31.87143, 29.03374, 25.40323, 20.75, 18.45455, 13.28571, 8.63924, 5.94186, 3.5]
            },
            {
              "type": "double",
              "attributes": {},
              "value": [16.33098, 11.95731, 10.86444, 10.22157, 13.27518, 11.25016, 9.36013, 7.96511, 5.49008, 2.61004, 0.67501]
            }
          ]
        }
      ]
    }
  ]
}


Try the mortAAR package in your browser

Any scripts or data that you put into this service are public.

mortAAR documentation built on Aug. 28, 2023, 1:06 a.m.