-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
100 lines (66 loc) · 4.14 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# lossrx <img src='man/figures/logo.png' align="right" height="139" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/jimbrig/lossrx/workflows/R-CMD-check/badge.svg)](https://github.com/jimbrig/lossrx/actions)
[![Lifecycle:experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Project Status:WIP](https://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)
<!-- badges: end -->
*View the [Changelog](inst/CHANGELOG.md) for detailed progression on development of the package.*
*View the [Latest Database Documentation](https://dbdocs.io/jimbrigf0cdc6204e/Actuarial-Database) for a detailed look into its structure.*
## Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**
- [Overview](#overview)
- [Installation](#installation)
- [Data](#data)
- [Data Preparation](#data-preparation)
- [Database](#database)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Overview
The desired outcome of the `lossrx` R package is to provide actuaries and data scientists valuable tools and frameworks for performing Property Casualty related workflows.
Specifically, the package will contain:
- A suite of utility and workflow oriented functions bundled as an R package
- A plumber API that serves various endpoints related to a backend database and models
- A comprehensive, yet simple migration-friendly relational database representing the various entities, attributes, and relationships involved with actuarial reserving.[^1]
- A demo Shiny App for Actuarial Loss Development and Reserving including triangles, loss development factor selection, preliminary ultimates, etc. and a backend database/API to store results and selections.
- Comprehensive documentation and tests
## Installation
You can install the development version of `lossrx` with `pak`: [^2]
```r
pak::pak("jimbrig/lossrx")
```
## Data
### Data Preparation
This package utilizes a lot of data and in turn has a lot of code inside the [data-raw](data-raw) folder. I recommend taking a look at its [README](data-raw/README.md) to gain an understanding of how the data was prepared for both use in the package as well as included and uploaded to the database.
Data is prepared in the following ways:
- Simulated transactional claims data using the [claims_transactional.R Simulation R Script](https://github.com/jimbrig/lossrx/blob/main/data-raw/scripts/claims_transactional.R)
- Downloaded and extracted using ropensci's [piggyback package](https://github.com/ropensci/piggyback) - see the [dataprep.R Script](https://github.com/jimbrig/lossrx/blob/main/data-raw/scripts/dataprep.R).
- Supplemental *mocked data* generated using the [Mockaroo API](https://www.mockaroo.com/) for randomizing certain data attribute's.
- Uploaded and merged into the relational database using `SQL`, `R`, `CSVs`, and `YAML` files (see below about database details).
- Certain datasets are budled and included with the package as native `.rda` packaged data files.
### Database
*View Detailed [Database Documentation](https://dbdocs.io/jimbrigf0cdc6204e/Actuarial-Database) created via `dbdocs`*
The core database files are housed in the [inst/database](inst/database) directory and are included on package installation.
[^1]: See the [database container package](https://github.com/jimbrig/lossrx/pkgs/container/actuarialdb) for details on how to run the database as a container image.
[^2]: Similarly, you can install the package using the more common `devtools::install_github()` and `remotes::install_github()`
## Checks
Latest `R CMD CHECK`:
```R
-- R CMD check results -------------------------------------- lossrx 0.0.2 ----
Duration: 1m 19.3s
0 errors v | 0 warnings v | 0 notes v
R CMD check succeeded
```
> Jimmy Briggs | 2022