Skip to content
Prev 32207 / 398506 Next

how to run R as a daemon

I  just visited the link you gave me. One of the problems that could 
occur using NuSOAP is that I do not intend using Python. Thanks anyway. 
I would also like to ask more precise questions :
- is it possible to run R as a standalone service, which runs in 
background indefinitely, waiting for instructions ? This would be a 
great improvement for me, since each time it is launched R has to 
re-load a (constant) matrix generated thanks to a database connection 
(takes a very long while)
- my R script is object-oriented; I define classes and methods, but I'm 
not so sure about how methods should be declared; I usually write 
something like :

mymethod <- function(.Object) UseMethod("mymethod",.Object);

setMethod("mymethod","myclass",
        function(.Object)
        {
            # instructions
            return(.Object);
        }
        );

Perhaps is this not the best way to write methods ? Could this explain 
the following fact : when I run the script, R spends about 1/3 of its 
thinking time creating the generic functions linked with my methods. 
Isn't this wasted time ? The same script may be executed many times 
consecutively by different users, and each time R has to re-define the 
generic functions ! (are always the same)

I use R 1.6.2 on a Linux server (Red Hat - soon Debian)
Marsland, John wrote: