[R] complain about a[-integer(0)]

PO SU rhelpmaillist at 163.com
Sat Oct 11 12:41:12 CEST 2014


Tks, i have to do it.....





--

PO SU
mail: desolator88 at 163.com
Majored in Statistics from SJTU



At 2014-10-11 17:57:40, "Jim Lemon" <jim at bitwrit.com.au> wrote:
>On Sat, 11 Oct 2014 05:25:14 PM PO SU wrote:
>> Dear helpeRs,
>>     let a <- 1:10
>>     let b <- integer(0) first, then i will randomly write a integer
>> differently in the range(1,10)  or NULL into b. for supposed 5 times. 
>then
>> i want to get a[-b],that means i not want the values at index b. if any
>> time of  5 times generate a integer, it works fine. but when all the 5
>> times generate NULL, it can't work! Because of  the  a[-integer(0)]
>> =integer(0) .
>>   I ask the same question once before, now i encount it again, i think
>> a[-integer(0)] should return a not integer(0) ! Is any one have the 
>same
>> idea with me ? or give me a oppisite case that a[-integer(0)] need to 
>be
>> integer(0) ?
>> 
>Hi PO SU,
>How about:
>
>if(length(b)) a<-a[-b]
>
>Jim
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list