Skip to content

function call from another r file

3 messages · sheenmaria, Jeff Newmiller, Suzen, Mehmet

#
How to call a function from another r file ?
Anyone can help me .

Having a function named like fun1 which is saved in r file file1.r
and i have another r file like file2.r, and  i need to call the fun1 (which
is in  file1) within file2.

Thank you




--
View this message in context: http://r.789695.n4.nabble.com/function-call-from-another-r-file-tp4650627.html
Sent from the R help mailing list archive at Nabble.com.
#
It is straightforward to load function definitions into memory using the source() function.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
sheenmaria <sheenmaria6 at gmail.com> wrote:

            
#
If you want to handle a generic case, best thing is to create an R
package. It is
much easier to manage that using source(), if you have lots of
different functionality
and data files. Also look at ?system.file.

On Sat, Nov 24, 2012 at 7:49 AM, Jeff Newmiller
<jdnewmil at dcn.davis.ca.us> wrote: