RLink`
RLink`

REnvironment

REnvironment[]

a container used by RLink to represent any R environment.

Details and OptionsDetails
  • Only the global R environment is fully supported. All other R environments are still represented by REnvironment[], but the specific information about them is lost. Therefore, R objects whose Wolfram Language representation contains references to non-global R environments cannot generally be correctly exported back to R.
  • Like RCode, REnvironment is a head providing representation rather than equivalence. Exporting to R objects previously imported to the Wolfram Language (or their parts) containing any of these heads is not guaranteed to produce equivalent objects in the R workspace.
  • Expressions with the REnvironment head transform trivially (are left unchanged) by the functions ToRForm and FromRForm.
  • Examples

    Basic Examples  (1)

    This loads RLink:

    In[1]:=
    Click for copyable input

    This creates a simple linear model:

    In[2]:=
    Click for copyable input

    The result is a rather complex R object:

    In[3]:=
    Click for copyable input
    Out[3]//Short=

    Some parts of this object contain explicit reference to an R environment:

    In[4]:=
    Click for copyable input
    Out[4]=

    This can also be seen as follows:

    In[5]:=
    Click for copyable input
    Out[5]=

    See Also

    RCode  RObject  RList  RVector  RNull  RFunction  REvaluate