Skip to content
Prev 48272 / 63424 Next

S3 - how to implement "colnames<-"

Hi Witold,
you should first of all redefine colnames to use UseMethod.
Then you have to write a colnames.default that uses base::colnames
(so that it does not interfere with existing code and other functions)
and the you can define the method for your class.

I would suggest, though, to use attributes for your object, rather
than risking to mess up the default R function.

Hope it helps,
Cheers,
Luca

2014-05-14 10:57 GMT+02:00 Witold E Wolski <wewolski at gmail.com>: