Re: [R] Saving a workspace with "extras"?

From: Sarah Goslee <sarah.goslee_at_gmail.com>
Date: Fri, 25 Jul 2008 10:35:01 -0400

Functions you've loaded using source() should be saved.

For loading packages automatically, create a function called .First and save it in that workspace. Anything in that function will be carried out when the workspace is loaded.

Sarah

On Fri, Jul 25, 2008 at 10:27 AM, <J.delasHeras_at_ed.ac.uk> wrote:
>
> Hi everyone,
>
> I hope there's a simple way to achieve what I want, but I haven't found the
> way.
>
> I do microarray analysis using R and a number of packages as well as some
> functions created my myself.
> When I save the workspace, it saves all the data structures, that's great...
> But when I click (I'm on Windows XP, if it matters) on teh resulting .RData
> file, I have to reload the functions I made, as well as the relevant
> packages. It is not really a big deal, but sometimes I want to give a
> colleague something I'm working on, and it would be a lot easier to just
> give the .RData file, without adding the extras. Especially when it comes to
> my own functions. I was hoping they'd be saved, because I see them listed
> after 'ls()' but they're not.
>
> I'm starting to suspect that this is another reason why people build
> packages... but it seems a bit involved, especially in Windows. I was shown
> how to do it in Linux and it wasn't painful, but in Windows... ouch. Tried
> and failed repeatedly. Gave up.
>
> Any comments appreciated!
>
> Jose
>

-- 
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Jul 2008 - 14:50:47 GMT

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 25 Jul 2008 - 15:02:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive