Skip to content
Prev 28915 / 63424 Next

rawToChar(raw(0))

On 5/21/08, Henrik Bengtsson <hb at stat.berkeley.edu> wrote:
I don't see why; rawToChar(, multiple=FALSE) is meant to be a map from
an n-vector to a scalar. Why should there be an exception when n==0?
Would you expect

mean(numeric(0))

to return numeric(0)?
The error message says it all: charToRaw() maps a scalar to an
n-vector. For vectors of length > 1, it uses the first element with a
warning.

No comments on the rest.

-Deepayan