[R] readBin documentation error

peter dalgaard pdalgd at gmail.com
Sat Sep 3 09:56:02 CEST 2016

> On 03 Sep 2016, at 03:24 , Yucheng Song via R-help <r-help at r-project.org> wrote:
> Thanks for the reply. What I meant was that there is no int(), if you do a ?readBin, you will find it there. 

Not as far as I can tell:

    what: Either an object whose mode will give the mode of the vector
          to be read, or a character vector of length one describing
          the mode: one of ‘"numeric"’, ‘"double"’, ‘"integer"’,
          ‘"int"’, ‘"logical"’, ‘"complex"’, ‘"character"’, ‘"raw"’.

Note: Either...or...

I.e., you can use a character string (==vector of length one) 

readBin(zz, "int", 8, size = 1) 

and you can use an object of the desired mode

readBin(zz, integer(), ...) or equivalently readBin(zz, 0L, ...)

but there is no implication that each of the possible character strings have a corresponding function. It is not clear why we allow  both "int" and "integer" here, but there is no reason to expect int() to exist.

Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com

More information about the R-help mailing list