[R] How to reuse my self function?

Tony Breyal tony.breyal at googlemail.com
Wed Mar 4 13:01:35 CET 2009


I usually use the ?source function.

so at the top of your test2.R file, you would put a line like:

source('C:\\test1.R')

but with the correct path to where ever you have stored your test1.R
file.

Hope that helps a little,
Tony


On 4 Mar, 10:29, Chang Jia-Ming <chang.jiam... at crg.es> wrote:
> Dear all,
>
>  I wrote a function test1 in test1.R.
>  Right, I am writing another function test2 on test2.R and trying to use
> test1 function.
>  How can I do?
>  Is there any similar way like including test1.R in test2.R file?
>
> Thank You Very Much.
>
> Jia-Ming
>
> ============================
> 張家銘  Jia-Ming Chang
> PhD Student
> Comparative Bioinformatics Group
> Bioinformatics and Genomics Programme
>
> Centre de Regulacio Genomica (CRG)
> Dr. Aiguader, 88
> 08003 Barcelona
> Spain
>
> E-Mail: chang.jiam... at crg.es
> chang.jiam... at gmail.com
> Web:http://www.iis.sinica.edu.tw/~jmchang/
> TEL: +34 933 160 223 ext. 1223
> CellPhone:+34 637 180 355
> ============================
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list