Bug 14424 - The ! operator loses dimensions on matrices
Summary: The ! operator loses dimensions on matrices
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Language (show other bugs)
Version: R 2.12.0
Hardware: Other Windows 32-bit
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
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