[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-help
Subject:    Re: [R] Don't collapse degenerate array indices
From:       Sebastian Schubert <schubert.seb () googlemail ! com>
Date:       2012-04-19 13:38:25
Message-ID: 4F901551.9020605 () googlemail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On 19/04/12 15:25, Duncan Murdoch wrote:
> On 19/04/2012 9:14 AM, Sebastian Schubert wrote:
>> Hi,
>>
>> I want to prohibit the automatic collapsing of degenerate array indices:
>>
>> >  str( array(1,dim=c(3,4,5,1,1)) )
>>   num [1:3, 1:4, 1:5, 1, 1] 1 1 1 1 1 1 1 1 1 1 ...
>> >  str( array(1,dim=c(3,4,5,1,1))[2:3,1:3,4:5,,] )
>>   num [1:2, 1:3, 1:2] 1 1 1 1 1 1 1 1 1 1 ...
>>
>> The last command removed the degenerate indices. I don't want that. What
>> can I do?
> 
> Use "drop=FALSE".  See ?"[".

Thanks a lot for the fast help, Duncan and David! Also thanks for the
hint of how to get help for [. I tried ?[ which did not work.

Sebastian




["signature.asc" (application/pgp-signature)]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic