Skip to content
Prev 311410 / 398513 Next

data after write() is off by 1 ?

On 20/11/2012 19:46, Duncan Murdoch wrote:
But as the help page says

      ?write? is a wrapper for ?cat?, which gives further details on the
      format used.

and cat() does treat a factor as an integer vector:

      Currently only atomic vectors and names are handled, together with
      ?NULL? and other zero-length objects (which produce no output).
      Character strings are output ?as is? (unlike ?print.default? which
      escapes non-printable characters and backslash - use
      ?encodeString? if you want to output encoded strings using ?cat?).
      Other types of R object should be converted (e.g. by
      ?as.character? or ?format?) before being passed to ?cat?.