Hello, I am building a package that creates a new kind of object not unlike a dataframe. However, it is not an extension of a dataframe, as the data themselves reside elsewhere. It only contains "metadata".
I would like to be able to retrieve data from my objects such as the number of rows, the number of columns, the colnames, etc. I --quite naively-- thought that ncol, nrow, colnames, etc. would be dispatched, so I would only need to create a, say, ncol.myclassname function so as to be able to invoke "ncol" directly and transparently. However, it is not the case. The only alternative I can think about is to create decorated versions of ncol, nrow, etc. to avoid naming conflicts. But I would still prefer my package users to be able to use the undecorated function names. Do I have a chance? Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.