Re: [R] Re: how to define functions in such a situation

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Tue 07 Jun 2005 - 23:20:47 EST

Look at the documentation for "source". You can source a file directly from the web:

source('http://myserver.com/somefile_on_web.R')

If that file contains R code for three functions, the functions will be "visible and useable immediately" in your workspace.

Sean

On Jun 7, 2005, at 8:58 AM, Hu Chen wrote:

> I got a dirty way to solve this.
> write a temp .R source file including these new functions, then
>> source(this_temp_file)

> but I don't know if there are some temp directory for R to store temp
> files?
>
> On 6/7/05, Hu Chen <chencheva@gmail.com> wrote:
>> hi R folks,
>> I need read a file from hardisk or www web. Then I need to define some
>> new functions according to the contents of the read file.
>> For example, i need write a package name "mypackage" like this:
>>> library(mypackage)
>>> read(some_file_on_web) #to see its content, suppose it contains:
>> eat.drink.sleep
>> then 3 new functions need to be created and usable.
>> the problem is, how could I create functions after executing
>> ">library(mypackage)" and make these new functions visible and usable
>> immediately?
>>
>> Any information are appreciated. forgive me if this question is very
>> stupid. but I really need help.
>> Thank you all.
>>
>
> ______________________________________________
> 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



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 Received on Tue Jun 07 23:40:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:26 EST