tests/testthat/_snaps/indices.md

lt.indices fails for wrong input

x is not an object of class mortaar_life_table or mortaar_life_table_list.

lt.indices produces the right output

{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["child_i", "d5_9", "d10_14", "juvenile_i", "d5_14", "d20plus", "senility_i", "d0plus", "d60plus", "p5_19", "D30_D5", "D0_14_D", "d0_14", "e0"]
    }
  },
  "value": [
    {
      "type": "double",
      "attributes": {},
      "value": [1.83333]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [22]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [12]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.21935]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [34]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [155]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.27742]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [247]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [43]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.2132]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.5668]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [0.34008]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [84]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [30.67139]
    }
  ]
}
{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["corpus mandibulae", "margo orbitalis"]
    }
  },
  "value": [
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["child_i", "d5_9", "d10_14", "juvenile_i", "d5_14", "d20plus", "senility_i", "d0plus", "d60plus", "p5_19", "D30_D5", "D0_14_D", "d0_14", "e0"]
        }
      },
      "value": [
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.13966]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [7.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [53.7]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.26629]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [67.2]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [14.3]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.15032]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.69345]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.17113]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [11.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [37.88839]
        }
      ]
    },
    {
      "type": "list",
      "attributes": {
        "names": {
          "type": "character",
          "attributes": {},
          "value": ["child_i", "d5_9", "d10_14", "juvenile_i", "d5_14", "d20plus", "senility_i", "d0plus", "d60plus", "p5_19", "D30_D5", "D0_14_D", "d0_14", "e0"]
        }
      },
      "value": [
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": []
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.06421]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [4]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [62.3]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.15249]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [74.8]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [9.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.10101]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.69118]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [0.12701]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [9.5]
        },
        {
          "type": "double",
          "attributes": {},
          "value": [34.7393]
        }
      ]
    }
  ]
}

helper function lt.mortality produces the right output

{
  "type": "list",
  "attributes": {
    "names": {
      "type": "character",
      "attributes": {},
      "value": ["q0_5", "q10_5", "q15_5", "q15_45"]
    }
  },
  "value": [
    {
      "type": "double",
      "attributes": {},
      "value": [20.24291]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [6.85714]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [4.90798]
    },
    {
      "type": "double",
      "attributes": {},
      "value": [68.57143]
    }
  ]
}


Try the mortAAR package in your browser

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

mortAAR documentation built on May 25, 2021, 1:07 a.m.