Dear All I inserted a frequently used function (subroutine) right into my Rprofile.site which allows me to run it each time-works great. However, this approach is obviously suitable for a short function or a small number of functions. Instead of inserting the lines in Rprofile.site, is there a way to insert one line pointing to (fetching) the function in a local drive, similar to #include c:\path\... in Gauss? Thank you. -- Steven T. Yen, Professor of Agricultural Economics The University of Tennessee http://web.utk.edu/~syen/ [[alternative HTML version deleted]]
source("c:\path\... ")
On Sun, Nov 27, 2011 at 9:28 PM, Yen, Steven T <syen@utk.edu> wrote:
> Dear All
>
> I inserted a frequently used function (subroutine) right into my
> Rprofile.site which allows me to run it each time-works great. However,
> this approach is obviously suitable for a short function or a small number
> of functions. Instead of inserting the lines in Rprofile.site, is there a
> way to insert one line pointing to (fetching) the function in a local
> drive, similar to #include c:\path\... in Gauss?
>
> Thank you.
>
>
>
> --
> Steven T. Yen, Professor of Agricultural Economics
> The University of Tennessee
> http://web.utk.edu/~syen/
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>
[[alternative HTML version deleted]]
or put them in an R package with some appropriate name like "YenMisc", then include "library(YenMisc)" in "Rprofile.site". This has the added advantage that you can easily share YenMisc with others. Spencer On 11/27/2011 6:42 PM, Florent D. wrote:> source("c:\path\... ") > > On Sun, Nov 27, 2011 at 9:28 PM, Yen, Steven T<syen at utk.edu> wrote: > >> Dear All >> >> I inserted a frequently used function (subroutine) right into my >> Rprofile.site which allows me to run it each time-works great. However, >> this approach is obviously suitable for a short function or a small number >> of functions. Instead of inserting the lines in Rprofile.site, is there a >> way to insert one line pointing to (fetching) the function in a local >> drive, similar to #include c:\path\... in Gauss? >> >> Thank you. >> >> >> >> -- >> Steven T. Yen, Professor of Agricultural Economics >> The University of Tennessee >> http://web.utk.edu/~syen/ >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> 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. >> > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Spencer Graves, PE, PhD President and Chief Technology Officer Structure Inspection and Monitoring, Inc. 751 Emerson Ct. San Jos?, CA 95126 ph: 408-655-4567 web: www.structuremonitoring.com
Spencer
Thanks! The first approach (source("...)" worked forme.
To "put them in an R package", if you tell me what to read to learn
it, I will. I am relatively new to R, content to just do the minimum for now to
program my own likelihood function using optim. Thanks. again.
________________________________________
From: Spencer Graves [spencer.graves at structuremonitoring.com]
Sent: Sunday, November 27, 2011 10:42 PM
To: Yen, Steven T
Cc: r-help at r-project.org
Subject: Re: [R] Rprofile.site
or put them in an R package with some appropriate name like "YenMisc",
then include "library(YenMisc)" in "Rprofile.site". This
has the added
advantage that you can easily share YenMisc with others. Spencer
On 11/27/2011 6:42 PM, Florent D. wrote:> source("c:\path\... ")
>
> On Sun, Nov 27, 2011 at 9:28 PM, Yen, Steven T<syen at utk.edu>
wrote:
>
>> Dear All
>>
>> I inserted a frequently used function (subroutine) right into my
>> Rprofile.site which allows me to run it each time-works great. However,
>> this approach is obviously suitable for a short function or a small
number
>> of functions. Instead of inserting the lines in Rprofile.site, is there
a
>> way to insert one line pointing to (fetching) the function in a local
>> drive, similar to #include c:\path\... in Gauss?
>>
>> Thank you.
>>
>>
>>
>> --
>> Steven T. Yen, Professor of Agricultural Economics
>> The University of Tennessee
>> http://web.utk.edu/~syen/
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.
>>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>
--
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San Jos?, CA 95126
ph: 408-655-4567
web: www.structuremonitoring.com