From p.dalgaard at biostat.ku.dk  Tue May 25 00:16:58 2004
From: p.dalgaard at biostat.ku.dk (p.dalgaard@biostat.ku.dk)
Date: Tue May 25 00:17:03 2004
Subject: [Rd] error in make.names docs (PR#6912)
Message-ID: <20040524221658.3ECCDEAD7@slim.kubism.ku.dk>

Peter Dalgaard <p.dalgaard@biostat.ku.dk> writes:

> Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
> 
> > Example output in comment is now corrected in R-patched.
> > What has the rest to do with a bug report?
> 
> He's hoping (with some reason) that the change of behaviour was the
> bug. I seem to recall some internal discussion of the effect, but not
> whether it just got forgotten or whether you might as well just do 
> gsub(...something...) on the names of the dataframe.

Apparently, the latter was the case. It is quite easy to fix the names
after reading, and adding a compatibility feature would be kludgy, and
not relieving you of changing the old code anyway. I have updated the
docs (for 1.9.1) with some more specific instructions about what to do:

diff -r1.9.4.1 make.names.Rd
31a32,36
> \note{
>   Prior to version 1.9.0, underscores were not valid in variable names,
>   and code that relies on them being converted to dots will no longer
>   work. The simplest workaround is to use \code{gsub("_", ".",
>   names)}.
> }

diff -r1.50 read.table.Rd
189a190,196
>
>   Prior to version 1.9.0, underscores were not valid in variable names,
>   and code that relies on them being converted to dots will no longer
>   work. The simplest workaround is to use
>    \code{names(d) <- gsub("_", ".", names(d))},
>   or, avoiding the (small) risk of creating duplicate names,
>    \code{names(d) <- make.names(gsub("_", ".", names(d)),
>   unique=TRUE)}.


-- 
   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


[Rd] error in make.names docs (PR#6912)
p.dalgaard@biostat.ku.dk