RLink`
RLink`
REnvironment
REnvironment[]
a container used by RLink to represent any R environment.
Details and Options
- 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)Summary of the most common use cases
In[1]:=1

✖
https://wolfram.com/xid/0dqma9v2m2zixzm-h8fcah
This creates a simple linear model:
In[2]:=2

✖
https://wolfram.com/xid/0dqma9v2m2zixzm-eos116
The result is a rather complex R object:
In[3]:=3

✖
https://wolfram.com/xid/0dqma9v2m2zixzm-hwm8ux

Some parts of this object contain explicit reference to an R environment:
In[4]:=4

✖
https://wolfram.com/xid/0dqma9v2m2zixzm-pfo11t
Out[4]=4

This can also be seen as follows:
In[5]:=5

✖
https://wolfram.com/xid/0dqma9v2m2zixzm-7muh0
Out[5]=5

Wolfram Research (2012), REnvironment, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
✖
Wolfram Research (2012), REnvironment, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
Text
Wolfram Research (2012), REnvironment, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
✖
Wolfram Research (2012), REnvironment, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
CMS
Wolfram Language. 2012. "REnvironment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
✖
Wolfram Language. 2012. "REnvironment." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/REnvironment.html.
APA
Wolfram Language. (2012). REnvironment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/RLink/ref/REnvironment.html
✖
Wolfram Language. (2012). REnvironment. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/RLink/ref/REnvironment.html
BibTeX
✖
@misc{reference.wolfram_2024_renvironment, author="Wolfram Research", title="{REnvironment}", year="2012", howpublished="\url{https://reference.wolfram.com/language/RLink/ref/REnvironment.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2024_renvironment, organization={Wolfram Research}, title={REnvironment}, year={2012}, url={https://reference.wolfram.com/language/RLink/ref/REnvironment.html}, note=[Accessed: 29-March-2025
]}