represents an internal form of an R list in RLink.
- The elements elems can be of any valid RLink object type.
- attributes must have the form RAttributes["name1":>value1,...], where values of attributes can be any R objects handled by RLink.
Basic Examples (9)
Like with RVector, most of the time, you will find it more convenient to use the short form of a list, rather than using RList directly. For example, a pair of an integer and a real number can be represented simply as:
Yo can use ToRForm to see the internal form of this list, which would involve RList:
One reason to use the head RList explicitly is when you want to treat some data as a list, which the automatic type detection of RLink would otherwise classify as a vector. For example, consider the following nested list:
As with RVector, you can send instances of RList directly to R:
You can always check what was sent to R by using REvaluate:
Also, as with RVector, the case when you assign some extra attributes is treated differently. Consider the following example:
This is reflected on the Wolfram Language side by the first result being wrapped in an extra List. This is also consistent with the conversion to the internal RLink form:
Wolfram Research (2012), RList, Wolfram Language function, https://reference.wolfram.com/language/RLink/ref/RList.html.
Wolfram Language. 2012. "RList." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/RLink/ref/RList.html.
Wolfram Language. (2012). RList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/RLink/ref/RList.html