Re: [R] Saving a function

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Tue 31 Oct 2006 - 07:40:45 GMT


Hi

  1. You can create your own package (set of functions) and load it each time you start R
  2. When quitting R you can save workspace. It will create a file named .Rdata in which your function is defined. Then you can load this workspace and use your function
  3. You can use some of dput, dget, source, save, load to write your function to a file and get it back to your R session
  4. You can consult manuals and help pages (R-intro, R-exts) or go through some texts available on CRAN to learn how exactly to do such things.

HTH
Petr

On 30 Oct 2006 at 18:26, patopatasfrias wrote:

Date sent:      	Mon, 30 Oct 2006 18:26:51 -0800 (PST)
From:           	patopatasfrias <mattinusa@gmail.com>
To:             	r-help@stat.math.ethz.ch
Subject:        	[R] Saving a function

>
> Hey, I'm a real novice... how do I go about saving a function that I
> created eg. If I created this function: Fun<-function(x1,X2) {......},
> how can I store it so that the next time I use R I can load it and not
> have to type it out again????
>
> Cheers
> Matt
> --
> View this message in context:
> http://www.nabble.com/Saving-a-function-tf2543540.html#a7087217 Sent
> from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.

Petr Pikal
petr.pikal@precheza.cz



R-help@stat.math.ethz.ch 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 Tue Oct 31 18:46:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 31 Oct 2006 - 08:30:14 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.