make_portfolio: Create Insurance Portfolio for Simulation

View source: R/make_portfolio.R

make_portfolioR Documentation

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)

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.

Value

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

Examples

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


volrisk documentation built on June 14, 2025, 9:07 a.m.