Bug 14424 - The ! operator loses dimensions on matrices
The ! operator loses dimensions on matrices
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Language
R 2.12.0
Other Windows 32-bit
: P5 enhancement
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-27 12:01 UTC by Duncan Murdoch
Modified: 2010-10-29 00:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Murdoch 2010-10-27 12:01:17 UTC
When a matrix has zero rows, the ! operator loses the dimension attribute.  

> M <- matrix(FALSE, 0, 2)
> dim(M)
[1] 0 2
> dim(!M)
NULL

It keeps the dimension for non-empty matrices:

> M <- matrix(FALSE, 2, 2)
> dim(!M)
[1] 2 2
> dim(!M)
[1] 2 2
Comment 1 Brian Ripley 2010-10-29 00:25:34 UTC
fixed in 2.12.0 patched