RAttributes

RAttributes[atts]

an RLink container for attributes of R objects.

Details and OptionsDetails
  • atts must be a sequence of zero, one, or more delayed rules, of the form name :> value, where name must be a string name of an attribute, and value can be any valid R object representation, which RLink can handle.
  • RAttributes is not normally used as a standalone expression, but rather as a part of expressions with heads RVector or RList.
  • For R vectors, the attribute dim is not included in RAttributes in the short form of R object representation, but is included in the long (full) form.
  • Examples

    Basic Examples  (3)

    In[1]:=
    Click for copyable input

    This represents the full internal form of a matrix:

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

    This is equivalent to the following short form:

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

    The following expression represents the full internal form of an R vector with an additional names attribute:

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

    This is equivalent to the following short form:

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

    You can send this vector to R:

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

    This returns the attributes of the vector used above, fetched from R:

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

    Looking at the internal form of this answer, you can see that in R, attributes are stored in a list:

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

    See Also

    RList  RNull  RObject  RVector  ToRForm  FromRForm

    Tutorials