Ejemplo n.º 1
0
def initr_simple() -> int:
    """Initialize R's embedded C library."""
    status = embedded._initr()
    atexit.register(endr, 0)
    _rinterface._register_external_symbols()
    _post_initr_setup()
    return status
Ejemplo n.º 2
0
def initr_simple() -> typing.Optional[int]:
    """Initialize R's embedded C library."""
    with openrlib.rlock:
        status = embedded._initr()
        atexit.register(endr, 0)
        _rinterface._register_external_symbols()
        _post_initr_setup()
        return status
Ejemplo n.º 3
0
def initr_checkenv() -> typing.Union[int, None]:
    # Force the internal initialization flag if there is an environment
    # variable that indicates that R was alreay initialized in the current
    # process.

    status = None
    with openrlib.rlock:
        if embedded.is_r_externally_initialized():
            embedded.setinitialized()
        else:
            status = embedded._initr()
            embedded.set_python_process_info()
        _rinterface._register_external_symbols()
        _post_initr_setup()
    return status
Ejemplo n.º 4
0
def rpy2_init():
    from rpy2.rinterface_lib.embedded import _initr
    _initr()