Re: [Rd] attach 'name' argument ignored with a file?

From: Prof Brian Ripley <>
Date: Fri, 23 Dec 2011 11:22:15 +0000 (GMT)

On Thu, 22 Dec 2011, Xavier Robin wrote:

> Dear experRts,
> I have the feeling that the 'name' argument to the attach function is
> ignored when 'what' is a file name. Here is an example:

In current R (2.14.1) it is documented to not be used in that case (and it is not).

> save(letters, file="letters.RData")
> letters.env <- attach("letters.RData", name="letters")
> search()
> letters.env
> The name on the search path is "file:letters.RData". I would expect it
> to be "letters"...
> Tested today with R-latest.

Whatever that is. This is not the 'at a minumum' information the posting guide asked you for, and it expressly asked you not to use inaccurate R version terminology.

> Is it by design? From the doc I read:

What 'doc', precisely, is that? This is not what ?attach in R 2.14.1 says.

>> name name to use for the attached database.
>> ...
>> The name given for the attached environment will be used by search and can be used as the argument to as.environment.
> I don't see why that would be restricted when 'what' is a file name.
> What do you think about it? Is it a bug or did I mis-read the doc?

It seems clear that there is a problem with your reading ... including of the posting guide, which asked you to check the current version of R *before posting*. And even check future versions of R (and you might find that illuminating).

> Regards,
> Xavier

Did I mention the posting guide?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Fri 23 Dec 2011 - 11:26:41 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 23 Dec 2011 - 20:00:19 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive