[R] How to inherit a base data type (e.g. list, vector)

Dawei Cheng waterfrogcdw at gmail.com
Sat Nov 14 04:43:20 CET 2015


Hi, there
I'm trying to extend customized type (for example mylist) from a base type
"list" in R, which contains all functions and prototype of R base "list".
It should support below operators as "list":

a <- list(column1=c(1:5), column2=c(6:10))
aa <- mylist(column1=c(1:5), column2=c(6:10))
a$column1
1 2 3 4 5
aa$column1
1 2 3 4 5

All other usages of "list" is expected to be supported my "mylist"

My questions is :
How could I create the "mylist" in R.
Thanks for help.

-- 

*Best RegardsDawei*

	[[alternative HTML version deleted]]



More information about the R-help mailing list