[Rd] Fwd: How to check if R interpreter is initiated

Duncan Murdoch murdoch.duncan at gmail.com
Fri Dec 20 22:07:15 CET 2013


On 13-12-20 2:00 PM, Sandip Nandi wrote:
> Hi R-Developers ,
>
> I am using R-3.1 , moved from R-2.15 . I am facing a problem which I have
> raised in R bug report with bug 15596 .
>
> My problem is how to check if R is initiated before initiating R
>
> I am embedding R in parallel environment and reusing process already
> running to reduce overhead . Each process is running infinitely. So when a
> process is reused,it finds R is already initialized there and throws the
> error.
>
> Till 2.15 it was solved using R_Is_running variable . So I am assuming
> there should be some flag or return value in R-3.0.2 which provides the
> user with information if already initialized .
>
> Anyone has faced the problem ?
>
> It will be great if anyone could suggest alternate solution to this problem
> for R-3.0.

As you've already been told:  just maintain your own variable for this. 
  Before initializing R, set it to 0.  After initializing R, set it to 1.

Duncan Murdoch



More information about the R-devel mailing list