From Xavier.Robin at unige.ch  Thu Dec 22 14:39:01 2011
From: Xavier.Robin at unige.ch (Xavier Robin)
Date: Thu, 22 Dec 2011 14:39:01 +0100
Subject: [Rd] attach 'name' argument ignored with a file?
Message-ID: <4EF332F5.60504@unige.ch>

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:

  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.

Is it by design? From the doc I read:

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

Regards,
Xavier



[Rd] attach 'name' argument ignored with a file?
Xavier Robin