Displaying 2 results from an estimated 2 matches for "array2d".
Did you mean:
array2
2019 Nov 15
2
class(<matrix>) |--> c("matrix", "arrary") [was "head.matrix ..."]
...is to solve the problem of 2D arrays, automatically
being mapped to matrices:
> class (array (1, c (2, 2) ) )
[1] "matrix"
Then wouldn't it be better, to treat 2D arrays, as a special case, and
leave matrices as they are?
> #mockup
> class (array (1, c (2, 2) ) )
[1] "array2d" "matrix" "array"
Then 2D arrays would have access to both matrix and array methods...
Note, I don't want to enter into (another) discussion on the
differences between implicit class and classes defined via a class
attribute.
That's another discussion, which has l...
2019 Nov 02
6
head.matrix can return 1000s of columns -- limit to n or add new argument?
Thanks Martin and Peter,
I agree that we can be careful and narrow and still see a nice improvement
in behavior. While Herve's point is valid and I understand his frustration,
I think staying within the matrix vs c(matrix, array) space is the right
scope for this work in terms of fiddling with inheritance.
As another point, I don't know off the top of my head of any other classes
which