Skip to content
Back to formatted view

Raw Message

Message-ID: <95FBCF04-B854-403E-94F3-6F0E0DA87667@comcast.net>
Date: 2012-11-07T20:53:26Z
From: David Winsemius
Subject: save/load and package namespaces
In-Reply-To: <CAJ_cGTqBRFaKz+rwcpnWreZpA7P9M9Y7Scop+0+9eNZB3Z28JQ@mail.gmail.com>

On Nov 7, 2012, at 9:50 AM, Jamie Olson wrote:

> Could someone explain to me what namespaces are loaded/saved when objects
> are saved?

None. That's what require() or library() or source() are for.

> 
> Specifically, I'm using this:
> save(list = ls(all.names = TRUE, envir = envir), file = name, envir =
> envir)
> to save out everything from an environment.

You need to read more carefully:

?ls
?objects
?search

> 
> Later, loading it on another machine, I'm surprised to see the load failing
> for being unable to load certain packages.  Could anyone help me understand
> why this happens?

`ls` with default settings only lists data and function objects that the user has defined. The history mechanism could be used to restore packages that were loaded during a session.

?history

You should be able to see this by looking at what ls() produces. It does not generally return a listing of items in loaded packages.

-- 

David Winsemius, MD
Alameda, CA, USA