[R] Assigning a new name to object loaded with "load()"

Rolf Turner rolf.turner at xtra.co.nz
Sat Jul 28 00:53:19 CEST 2012


On 28/07/12 06:59, Alireza Mahani wrote:
> I would like to load a binary file into R using load(), and then assign a new
> name to it, regardless of the name it was saved under. Can you please
> provide a code sample? Thank you!

Ummm,  what is the antecedent of the pronoun "it" in the forgoing?

The structure of your sentence makes it sound like "it" refers to
***the binary file*** --- but I don't believe that's what you mean.

If you by "it" you mean an object (the object? one of the objects?) in
the saved binary file, then something like:

     y <- x
     rm(x)

should do what you want.

Distinguish the container from the thing(s) contained.

     cheers,

         Rolf Turner



More information about the R-help mailing list