Skip to content

Instantly share code, notes, and snippets.

View jeremyhoughton's full-sized avatar

jeremyhoughton

View GitHub Profile
@jeremyhoughton
jeremyhoughton / RectangularClaimsDevelopment.R
Last active May 8, 2019 10:39
Example of handling a Rectangular Claims Development
install.packages("dplyr")
install.packages("ChainLadder")
library(ChainLadder)
library(dplyr)
# Based on this documentation here: https://rdrr.io/cran/ChainLadder/man/qpaid.html
applyProjectionMethod <- function(rectTriangle, projectionMethod) {
originYearCount <- nrow(rectTriangle)
@jeremyhoughton
jeremyhoughton / ExcelDataReaderExample.fsx
Created February 9, 2016 02:47
Example of Reading an Excel Workbook using ExcelDataReader
#r "../packages/ExcelDataReader/lib/net45/Excel.dll"
#r "../packages/SharpZipLib/lib/20/ICSharpCode.SharpZipLib.dll"
open Excel
open System.IO
open System.Data
open System.Xml
let extractData fileName sheetName =
use stream = File.Open(fileName, FileMode.Open, FileAccess.Read)
// Comparison of Basic Data Analysis using Core Seq, Array functions and FLinq
open System
// Test Data
let scoreData =
[| ("Jack", 4000); ("Jack", 5000); ("Jill", 3000); ("Tom", 1000); ("Jill", 6000) |]
let regionData =
[| ("Jack", "Region 1"); ("Sally", "Region 2"); ("Tom", "Region 3") |]