Macaulay2 » Documentation
Packages » RInterface » RObject
next | previous | forward | backward | up | index | toc

RObject -- R object

Description

An RObject is a SEXP (pointer) to an R object in memory. Note that in R, most objects are actually vectors, and scalars are just vectors of length 1.

RObject is a SelfInitializingType, and so it acts as its own constructor method. When passed a Macaulay2 object as input, the corresponding R object is returned. See the converting to R objects section below for the supported input types.

Each RObject is displayed by calling R's capture.output function.

i1 : RObject {2, 4, 6, 8}

--error or time limit reached in conversion of output to net: type 'debugError()' to run it again; will try conversion to string

o1 = 2, 4, 6, 8

o1 : RObject of type integer
i2 : RObject pi

--error or time limit reached in conversion of output to net: type 'debugError()' to run it again; will try conversion to string

o2 = 3.14159265358979

o2 : RObject of type double

It is converted to a string using R's toString function.

i3 : toString RObject {2, 4, 6, 8}

o3 = 2, 4, 6, 8

Menu

converting to R objects

converting from R objects

extracting or replacing parts

iteration

arithmetic operators

relational operators

logical operators

bitwise operators

rounding

maxima, minima, sums, and products

power, exponential, and logarithmic functions

trigonometric functions

hyperbolic functions

complex number functions

special mathematical functions

formulas

Methods that use a R object:

For the programmer

The object RObject is a self initializing type, with ancestor classes voidstar < ForeignObject < HashTable < Thing.


The source of this document is in RInterface/doc/objects.m2:127:0.