This constructs a list (vector) of random integers in R:
| Out[1]= |  |
This makes a contingency table of the above data:
| Out[2]= |  |
Since the corresponding R object (table) has non-trivial attributes,
was used to make it possible to include those.
This constructs an R data frame out of the contingency table:
| Out[1]= |  |
Here is the full internal form RLink uses to represent the above data frame:
| Out[2]= |  |
As you can see,
is now gone, since heads used in the RLink internal representation of R objects (RVector and RList) can accommodate attributes.
This creates a matrix:
| Out[1]= |  |
Send it to R:
| Out[2]= |  |
Assign another attribute to R's mat variable:
| Out[3]= |  |
Get back a resulting R object:
| Out[4]= |  |
Since now it has an attribute,
was used to represent it. You can also display its attributes:
| Out[5]= |  |
Note that the "dim" attribute is implicit in the matrix representation in the short form, so its presence does not require the use of
. It is, however, explicitly present in the full form:
| Out[6]= |  |