0

I'm currently coding an insurance premium tool, which needs to link a formula for specific contract, i.e. pure endowment (survival benefit)

In order to do so, it needs a population vector based on the age input on the sliderInput, which I already have prepared in a dataframe.

But I'm not sure how to link the formula to R, like how do I say to R, for any age input and any benefit term, we can take data from the dataframe.

Additional background:

kPx = probablity aged x lives another k years

The formula to calculate kPx:

kPx = population at x+k / population at x.

I've got the population vector in a dataframe, i just need to tell R for a certain age and certain benefit term, we'll get it from the specific dataframe.

Harrison Jones
  • 2,256
  • 5
  • 27
  • 34
matcha
  • 1
  • 1
  • 1
    What have you tried? It will help if you provide a reproducible example: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – VvdL Oct 12 '22 at 10:25

0 Answers0