Learn R Programming

ChainLadder (version 0.1.7)

triangles-class: S4 Class "triangles"

Description

This is a S4 class that has "list" in the data part. This class is created to facilitate validation and extraction of data.

Arguments

Objects from the Class

Objects can be created by calls of the form new("triangles", ...), or use as(...,"triangles"), where ... is a "list".

Extends

Class "list", from data part. Class "vector", by class "list", distance 2.

See Also

See also MultiChainLadder

Examples

Run this code
data(auto)

# "coerce"
auto <- as(auto,"triangles")  # transform "list" to be "triangles"

# method for "["
auto[,4:6,drop=FALSE] # rows of all NA's not dropped
auto[,4:6]			# drop rows of all NA's

auto[8:10, ,drop=FALSE] #columns of all NA's not dropped
auto[8:10, ] 			#columns of all NA's  dropped

auto[1:2,1]

# replacement method
auto[1:2,1] <- list(1,2,3)
auto[1,2]
   
dim(auto)

cbind2(auto[1:2,1])
rbind2(auto[1:2,1])

Run the code above in your browser using DataLab