Skip to content

mode or parameters of readBin

3 messages · Sigbert Klinke, Duncan Murdoch, Thomas Lumley

#
Hi,

 > sapply(formals("readBin"), mode)
      con      what         n      size    signed    endian
   "name"    "name" "numeric" "logical" "logical"    "call"

returns for the mode of size logical. But in the documentation is said 
that size should be integer. Does anyone know why the mode is logical?

Thanks in advance

Sigbert Klinke
#
On 9/10/2007 10:26 AM, Sigbert Klinke wrote:
The default value is NA, and the mode of NA is logical.  (It will 
automatically be promoted into another type if included in a vector, 
e.g. c(1:2, NA) promotes it to integer, c(3.14, NA) promotes it to numeric.)

More generally, I'd say reading the man page or the source is a better 
way to find out about the requirements for the arguments of a function.

Duncan Murdoch
#
On Mon, 10 Sep 2007, Sigbert Klinke wrote:

            
Because NA is a logical constant.

 	-thomas