Thank you, John. Understood. The "is a" construct makes more sense for my
purposes as the class users will "expect" matrix behavior.
Initially (no pun intended) it was counter-intuitive to me that initialize
checked validity, but now it seems like a reasonable compromise.
In the long term I will
Re: the validity bug. It's just as your example suggests: the
inherited initialize() method for "matrix" fails to call validObject().
Should be easy to fix. (Although it points out that the code should
perhaps be reorganized so the initialize() method is not responsible for
checking validit
> Daniel Murphy
> on Wed, 5 May 2010 22:08:06 -0700 writes:
> Sirs:
> My validity function did not run when my class contains="matrix". But if I
> first define the class with contains="numeric", then define it again
> with contains="matrix", validity runs. Here's the s
Hello,
I made a mistake and passed stringsAsFactors to the wrong function in :
> df <- as.data.frame( list( x = 1:3, y = c("a", "b", "c" ),
stringsAsFactors = FALSE ) )
But then :
> df
x y
1 1 a
2 2 b
3 3 c
and :
> df[["y"]]
[1] a b c
Levels: a b c
> str( df )
'data.frame': 3 obs. of