# NOT RUN {
#simple classes
alphabet.1 <- function ()
structure (LETTERS, class="alphabet.1")
alphabet.2 <- function ()
structure (sample (LETTERS), class="alphabet.2")
#simple 2x2 ObjectArray
x <- ObjectArray (,c (2, 2) )
x [[1, 1]] <- alphabet.1 ()
x [[2, 1]] <- alphabet.1 ()
x [[1, 2]] <- alphabet.2 ()
x [[2, 2]] <- alphabet.2 ()
#printed with default formatting
x
#objtag methods
objtag.alphabet.1 <- function (x)
paste ("<A1 ", x [1], ":", x [26], ">", sep="")
objtag.alphabet.2 <- function (x)
paste ("<A2 ", x [1], ":", x [26], ">", sep="")
#reprinted with custom formatting
x
# }
Run the code above in your browser using DataLab