From ripley at stats.ox.ac.uk  Mon May 24 18:04:23 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon May 24 18:04:34 2004
Subject: [Rd] error in make.names docs (PR#6912)
In-Reply-To: <20040524155822.9E894EB66@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.44.0405241703230.4717-100000@gannet.stats>

Example output in comment is now corrected in R-patched.
What has the rest to do with a bug report?

On Mon, 24 May 2004 mmiller3@iupui.edu wrote:

> Full_Name: Mike Miller
> Version: 1.9.0
> OS: win2000
> Submission from: (NULL) (134.68.121.109)
> 
> 
> The docs for make.names imply that the result of 
> 
>    make.names(c("a and b", "a_and_b"), unique=TRUE)
> 
> should be 
>    
>     "a.and.b"  "a.and.b.1"
> 
> when it is actually 
> 
>     "a.and.b" "a_and_b"
> 
> The docs do not reflect this very major change in behavior from 1.8.x to 1.9.0. 
> This change causes numerous R codes to fail in senarios like the following. 
> Suppose I have a data file, example.dat, like this:
> 
> a b x   some_factor
> 1 1 0.4 orange
> 2 1 0.3 blue
> 1 1 0.2 dog
> 2 1 0.1 orange
> 1 2 0.4 blue
> 2 2 0.3 dog
> 1 2 0.2 orange
> 2 2 0.1 blue
> 
> To read and use this in a version independent way, I've tried to write
> version-aware code, but this is difficult as '_' is not syntactically valid
> prior to R 1.9.0.  If it were, the following code might work.  Of course, if '_'
> were allowed, this issue would not be be a problem.
> 
> df <- read.table('example.dat',header=T)
> if ( version['minor'] == "9.0" ) {
>   plot(x ~ some_factor, data=df)
> } else {
>   plot(x ~ some.factor, data=df)
> }
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] error in make.names docs (PR#6912)
Prof Brian Ripley