Slide 34
Slide 34 text
Rにおける継承の基本
クラスの重要な利点のひとつが「継承」
例: print
や plot
関数を継承して独自の出力が可能
基本関数に .package名
を付けることで専用の処理を定義
plot.exametrika <- function(x,
type = c(
"IIC", "ICC", "TIC",
"IRP", "TRP", "LCD", "CMP",
"FRP", "RMP", "LRD", "Array",
"FieldPIRP", "LDPSR"
),
items = NULL,
students = NULL,
nc = 1,
nr = 1, ...) {
value <- if (length(class(x)) > 1) tail(class(x), 1) else "None"
The way to CRAN
34