If possible, the Macaulay2 equivalent of the given RObject is returned.
Note that most R objects are vectors. When a vector has length 1, the corresponding Macaulay2 object is returned as a scalar.
When the input is R's NULL, null is returned.
|
|
When the input is a logical vector, a Boolean is returned.
|
|
When the input is an integer vector, a ZZ object is returned.
|
|
When the input is a double vector, a RR object is returned.
|
|
When the input is a complex vector, a CC object is returned.
|
|
When the input is a character vector, a String object is returned.
|
|
When the input is a vector with more than one element, a List object is returned.
|
|
When the input is a pairlist (R's linked list type), a Sequence is returned.
|
|
There also exists a list type in R, created by the function list, that may contain elements of of any type, much like Macaulay2 lists. When the input is such a list, a List object is returned.
|
|
|
When the input is a matrix or array, a nested List object is returned. Note that R uses column-major order for matrices, unlike Macaulay2, which uses row-major order. No attempt is made to change the order, unlike new RObject from Matrix, which does do this conversion. For the most part, value and RObject are inverses of one another, but this is an exception.
|
|
|
|
When the input has any names, the elements with names are returned as Option objects.
|
|