From p.dalgaard@biostat.ku.dk  Thu Oct  4 13:43:27 2001
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 04 Oct 2001 14:43:27 +0200
Subject: [Rd] Bug when trying to save a character vector with an embedded / (PR#1115)
In-Reply-To: <200110041128.NAA17057@pubhealth.ku.dk>
References: <200110041128.NAA17057@pubhealth.ku.dk>
Message-ID: <x2adz74lu8.fsf@blueberry.kubism.ku.dk>

a296180@mica.fmr.com writes:

> VIA\B			# This is how the string should look.
> > save(test, ascii = TRUE, file = "here")
> > remove(list = ls())
> > ls()
> character(0)
> > load("here")
> > ls()
> [1] "test"
> > cat(test, "\n")
> VIAB		# This is not how the string should look! Where did the \ go?

Fixed now for r-devel. Will commit shortly.

(Martin, here's a way to test all characters:

 x <- y <- unlist(as.list(
   parse(text=paste("\"\\",
         as.character(structure(0:255,class="octmode")),
         "\"",sep=""))))
 save(x, ascii=T, file="here")
 load("here")
 all(x==y)

- I'd commit it for the regression test suite, but I'm not sure what
our conventions are for temporary files)

BTW: printing and deparsing x and y causes display corruption. Perhaps
we should have an isprint somewhere? 

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Bug when trying to save a character vector with an embedded / (PR#1115)
Peter Dalgaard BSA