From lgautier at gmail.com  Mon May  4 01:02:28 2015
From: lgautier at gmail.com (Laurent Gautier)
Date: Sun, 3 May 2015 19:02:28 -0400
Subject: [Rd] C-API: check whether R has been initialized ?
In-Reply-To: <55469D5B.5030701@gmail.com>
References: <CA+JCgN12YVXnWggr1PTfp81U6Bg3=4ARatOdfNh8wZXM_Aes8g@mail.gmail.com>
	<55469D5B.5030701@gmail.com>
Message-ID: <CA+JCgN3VW3qe+dDMyfSRJEAUdv-kjjG--HHwwbZk5isH8=oVAQ@mail.gmail.com>

Beside the possible argumentation that with an API elegance and convenience
might sometimes be superior to necessity, the suggested pattern ("every
program, including R itself, keeping its own flag") does no work too well
when the nested embedding of R is involved.

A concrete example is:
```
$ R -q
> library('rPython'); python.exec('import rpy2.robjects')
R is already initialized
```

https://bitbucket.org/rpy2/rpy2/issue/278/r-in-python-via-rpy2-in-r-via-rpython#comment-17843761

2015-05-03 18:12 GMT-04:00 Duncan Murdoch <murdoch.duncan at gmail.com>:

> On 03/05/2015 4:34 PM, Laurent Gautier wrote:
> > Hi,
> >
> > There appear to be no way to check whether R has already been
> initialized.
> >
> > Could a function like "Rf_isinitialized" be added to the API ?
> >
>
> Surely any program that needs to know that could keep its own flag.
> You'll need to give a much longer argument about why this is necessary
> for what you're doing.
>
> Duncan Murdoch
>
>

	[[alternative HTML version deleted]]



[Rd] C-API: check whether R has been initialized ?
Laurent Gautier