Learn R Programming

volrisk (version 0.1.0)

make_portfolio: Create Insurance Portfolio for Simulation

Description

This function standardizes and validates raw insurance portfolio data to prepare it for simulation. It ensures all necessary fields are correctly mapped and conform to required formats. If no column mapping is provided, the user will be prompted interactively.

Usage

make_portfolio(data, cols = NULL)

Value

A cleaned data.frame with standardized column names: unique_id, client_id, duration, mortality, lapse, nar, rate.

Arguments

data

A data.frame containing raw insurance portfolio data.

cols

A named list with column mappings. The list should include: unique_id, client_id, duration, mortality, lapse, nar, rate.

Examples

Run this code
make_portfolio(example_portfolio, cols = list(
  unique_id = "POL_ID",
  client_id = "CLIENT_ID",
  duration = "DURATION",
  mortality = "MORTALITY",
  lapse = "LAPSE",
  nar = "NAR",
  rate = "RATE"
))

Run the code above in your browser using DataLab