From murdoch at stats.uwo.ca  Tue Nov 21 12:00:21 2006
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Tue, 21 Nov 2006 06:00:21 -0500
Subject: [Rd] packBits (PR#9374)
In-Reply-To: <20061121050909.8C2463D747@slim.kubism.ku.dk>
References: <20061121050909.8C2463D747@slim.kubism.ku.dk>
Message-ID: <4562DC45.1080807@stats.uwo.ca>

On 11/21/2006 12:09 AM, prokaj at cs.elte.hu wrote:
> Full_Name: Prokaj Vilmos
> Version: R 2-4-0
> OS: Windows
> Submission from: (NULL) (193.224.79.8)
> 
> 
> PackBits(rbinom(32,1,0.5)==1,"integer")
> does not work. 
> 
> z<-packBits(rbinom(32,1,.5)==1,"integer")
> Error in packBits(x, type) : argument 'x' must be raw, integer or logical
> 
> 
> Taking a closer look at the C code 
> main/character.c  do_packBits rutin
> one can find the following checking
> 
>  if (TYPEOF(x) != RAWSXP && TYPEOF(x) != RAWSXP && TYPEOF(x) != INTSXP)
>      errorcall(call, _("argument 'x' must be raw, integer or logical"));
> 
> It's obvious that some of the RAWSXP should be LGLSXP

No need for me to fix this:  Brian Ripley got there first.

Duncan Murdoch



[Rd] packBits (PR#9374)
Duncan Murdoch