This is RInterface.info, produced by Macaulay2, version 1.24.11

RInterface -- interface to R for statistical computing
******************************************************

Description
===========

This package allows for the ability to interface with R (see
https://www.r-project.org/ ) for statistical computing inside Macaulay2.

+-----------------------------------------------------------------------------+
|i1 : dataFrame = RFunction "data.frame"                                      |
|                                                                             |
|o1 = dataFrame                                                               |
|                                                                             |
|o1 : RFunction                                                               |
+-----------------------------------------------------------------------------+
|i2 : chisqTest = RFunction "chisq.test"                                      |
|                                                                             |
|o2 = chisqTest                                                               |
|                                                                             |
|o2 : RFunction                                                               |
+-----------------------------------------------------------------------------+
|i3 : M = dataFrame(F => {762, 327, 468}, M => {484, 239, 477},               |
|         "row.names" => {"Democrat", "Independent", "Republican"})           |
|                                                                             |
|o3 =               F   M                                                     |
|     Democrat    762 484                                                     |
|     Independent 327 239                                                     |
|     Republican  468 477                                                     |
|                                                                             |
|o3 : RObject of type list                                                    |
+-----------------------------------------------------------------------------+
|i4 : chisqTest M                                                             |
|                                                                             |
|o4 =                                                                         |
|             Pearson's Chi-squared test                                      |
|                                                                             |
|     data:  structure(list(F = c(762L, 327L, 468L), M = c(484L, 239L, 477L)),|
|     X-squared = 30.07, df = 2, p-value = 2.954e-07                          |
|                                                                             |
|                                                                             |
|o4 : RObject of type list                                                    |
|-----------------------------------------------------------------------------|
|class = "data.frame", row.names = c("Democrat", "Independent", "Republican"))|
+-----------------------------------------------------------------------------+
|i5 : value oo_"p.value"                                                      |
|                                                                             |
|o5 = 2.953589183211757e-7                                                    |
|                                                                             |
|o5 : RR (of precision 53)                                                    |
+-----------------------------------------------------------------------------+

Author
======

  * Doug Torrance (see https://webwork.piedmont.edu/~dtorrance )
    <dtorrance@piedmont.edu>

Version
=======

This documentation describes version 0.1 of RInterface.

Source code
===========

The source code from which this documentation is derived is in the file
RInterface.m2 (see common/share/Macaulay2/RInterface.m2 ). The auxiliary files
accompanying it are in the directory RInterface/ (see
common/share/Macaulay2/RInterface/ ).

Exports
=======

  * Types
      * RFunction -- R function
      * RObject -- R object
  * Functions and commands
      * library -- load an R package
      * RSymbol -- return an R object using its symbol name
  * Methods
      * ?? RObject (missing documentation)
      * "+ RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "- RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject % RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject % Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject * RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject * Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject + RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject + Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject - RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject - Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject / RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject / Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject // RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject // Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject ^ RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject ^ Thing" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing % RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing * RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing + RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing - RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing / RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing // RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "Thing ^ RObject" -- see arithmetic operators on RObjects,
        -- arithmetic operators on R objects
      * "RObject & RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical
        operations on R objects
      * "RObject & Thing" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject << RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical
        operations on R objects
      * "RObject << Thing" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject >> RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical
        operations on R objects
      * "RObject >> Thing" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject ^^ RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical
        operations on R objects
      * "RObject ^^ Thing" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject | RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical
        operations on R objects
      * "RObject | Thing" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject ~" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "Thing & RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "Thing << RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "Thing >> RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "Thing ^^ RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "Thing | RObject" -- see bitwise logical operations on RObjects,
        -- bitwise logical operations
        on R objects
      * "RObject _ Thing" -- see extract or replace parts of RObjects,
        -- extract or replace parts of R
        objects
      * "RObject _ Thing = Thing" -- see extract or replace parts of RObjects,
        -- extract or replace
        parts of R objects
      * "RObject Array" -- see extract or replace parts of RObjects,
        -- extract or replace parts of R
        objects
      * "RObject SPACE Array = Thing" -- see extract or replace parts of RObjects,
        -- extract or replace
        parts of R objects
      * "conjugate(RObject)" -- see functions on RObjects representing complex numbers,
        --
        functions on R objects representing complex numbers
      * "imaginaryPart(RObject)" -- see functions on RObjects representing complex numbers,
        -- functions on R objects representing complex numbers
      * "realPart(RObject)" -- see functions on RObjects representing complex numbers,
        --
        functions on R objects representing complex numbers
      * "acosh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * "asinh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * "atanh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * "cosh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * "sinh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * "tanh(RObject)" -- see hyperbolic functions on RObjects,
        -- hyperbolic functions on R objects
      * iterator(RObject) -- iterate through an R
        object
      * length(RObject) -- the length of an R
        object
      * "exp(RObject)" -- see logarithmic and exponential functions on RObjects,
        --
        logarithmic and exponential functions on R objects
      * "expm1(RObject)" -- see logarithmic and exponential functions on RObjects,
        --
        logarithmic and exponential functions on R objects
      * "log(RObject)" -- see logarithmic and exponential functions on RObjects,
        --
        logarithmic and exponential functions on R objects
      * "log1p(RObject)" -- see logarithmic and exponential functions on RObjects,
        --
        logarithmic and exponential functions on R objects
      * "not RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject and RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject and Thing" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject or RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject or Thing" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject xor RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "RObject xor Thing" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "Thing and RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "Thing or RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "Thing xor RObject" -- see logical operators on RObjects,
        -- logical operators on R objects
      * "max(RObject)" -- see maxima and minima of RObjects,
        -- maxima and minima of R objects
      * "min(RObject)" -- see maxima and minima of RObjects,
        -- maxima and minima of R objects
      * "abs(RObject)" -- see miscellaneous mathematical functions on RObjects,
        --
        miscellaneous mathematical functions on R objects
      * "sqrt(RObject)" -- see miscellaneous mathematical functions on RObjects,
        --
        miscellaneous mathematical functions on R objects
      * product(RObject) -- product of R object
      * "RObject == RObject" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "RObject == Thing" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "RObject ? RObject" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "RObject ? Thing" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "Thing == RObject" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "Thing ? RObject" -- see relational operators on RObjects,
        -- relational operators on R objects
      * "new RFunction from RObject" -- see RFunction, -- R
        function
      * "new RFunction from String" -- see RFunction, -- R
        function
      * "net(RObject)" -- see RObject, -- R object
      * "new RObject from Boolean" -- see RObject, -- R object
      * "new RObject from CC" -- see RObject, -- R object
      * "new RObject from List" -- see RObject, -- R object
      * "new RObject from Matrix" -- see RObject, -- R object
      * "new RObject from Nothing" -- see RObject, -- R object
      * "new RObject from Number" -- see RObject, -- R object
      * "new RObject from RR" -- see RObject, -- R object
      * "new RObject from Sequence" -- see RObject, -- R object
      * "new RObject from String" -- see RObject, -- R object
      * "new RObject from Symbol" -- see RObject, -- R object
      * "new RObject from ZZ" -- see RObject, -- R object
      * "RObject .. RObject" -- see RObject _colon_ RObject,
        -- R colon operator
      * "RObject .. Thing" -- see RObject _colon_ RObject,
        -- R colon operator
      * RObject _colon_ RObject -- R colon operator
      * "RObject : Thing" -- see RObject _colon_ RObject,
        -- R colon operator
      * "Thing .. RObject" -- see RObject _colon_ RObject,
        -- R colon operator
      * "Thing : RObject" -- see RObject _colon_ RObject,
        -- R colon operator
      * "ceiling(RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "floor(RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "round(RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "round(RObject,RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "round(RObject,Thing)" -- see rounding of RObjects,
        -- rounding of R objects
      * "round(Thing,RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "truncate(RObject)" -- see rounding of RObjects,
        -- rounding of R objects
      * "RSymbol(String)" -- see RSymbol, -- return an R object
        using its symbol name
      * "Beta(RObject,RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "Beta(RObject,Thing)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "Beta(Thing,RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "binomial(RObject,RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "binomial(RObject,Thing)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "binomial(Thing,RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "Digamma(RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "Gamma(RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "lngamma(RObject)" -- see special mathematical functions on RObjects,
        -- special
        mathematical functions on R objects
      * "RObject !" -- see special mathematical functions on RObjects,
        -- special mathematical
        functions on R objects
      * sum(RObject) -- sum of R object
      * "acos(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * "asin(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * "atan(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * "atan2(RObject,RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric
        functions on R objects
      * "atan2(RObject,Thing)" -- see trigonometric functions on RObjects,
        -- trigonometric
        functions on R objects
      * "atan2(Thing,RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric
        functions on R objects
      * "cos(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * "sin(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * "tan(RObject)" -- see trigonometric functions on RObjects,
        -- trigonometric functions on R
        objects
      * value(RObject) -- convert R object to
        Macaulay2
  * Other things
      * NA -- missing value

For the programmer
==================

The object RInterface, is a package (Macaulay2Doc).

arithmetic operators on RObjects -- arithmetic operators on R objects
*********************************************************************

The standard arithmetic operators are available when working with R objects,
and in particular, numeric and complex vectors.

See + (Macaulay2Doc), and - (Macaulay2Doc), are both available as
unary operators.

+----------------------------+
|i1 : x = RObject(-5)        |
|                            |
|o1 = [1] -5                 |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : +x                     |
|                            |
|o2 = [1] -5                 |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : -x                     |
|                            |
|o3 = [1] 5                  |
|                            |
|o3 : RObject of type integer|
+----------------------------+

See + (Macaulay2Doc), - (Macaulay2Doc), * (Macaulay2Doc),
see / (Macaulay2Doc), and ^ (Macaulay2Doc),
are available as binary operators with the expected behavior.

+----------------------------+
|i4 : x = RObject 5          |
|                            |
|o4 = [1] 5                  |
|                            |
|o4 : RObject of type integer|
+----------------------------+
|i5 : y = RObject 2          |
|                            |
|o5 = [1] 2                  |
|                            |
|o5 : RObject of type integer|
+----------------------------+
|i6 : x + y                  |
|                            |
|o6 = [1] 7                  |
|                            |
|o6 : RObject of type integer|
+----------------------------+
|i7 : x - y                  |
|                            |
|o7 = [1] 3                  |
|                            |
|o7 : RObject of type integer|
+----------------------------+
|i8 : x * y                  |
|                            |
|o8 = [1] 10                 |
|                            |
|o8 : RObject of type integer|
+----------------------------+
|i9 : x / y                  |
|                            |
|o9 = [1] 2.5                |
|                            |
|o9 : RObject of type double |
+----------------------------+
|i10 : x^y                   |
|                            |
|o10 = [1] 25                |
|                            |
|o10 : RObject of type double|
+----------------------------+

See // (Macaulay2Doc), and % (Macaulay2Doc), have their usual
Macaulay2 behaviors of floor division and modulus, respectively,  wrapping
around R's %/% and %%.

+-----------------------------+
|i11 : x // y                 |
|                             |
|o11 = [1] 2                  |
|                             |
|o11 : RObject of type integer|
+-----------------------------+
|i12 : x % y                  |
|                             |
|o12 = [1] 1                  |
|                             |
|o12 : RObject of type integer|
+-----------------------------+

For the binary operators, one of the operands may be a Macaulay2 object.  It
will be converted to an RObject, before the operation is
performed.

+-----------------------------+
|i13 : x + 2                  |
|                             |
|o13 = [1] 7                  |
|                             |
|o13 : RObject of type integer|
+-----------------------------+
|i14 : 5 + y                  |
|                             |
|o14 = [1] 7                  |
|                             |
|o14 : RObject of type integer|
+-----------------------------+

bitwise logical operations on RObjects -- bitwise logical operations on R objects
*********************************************************************************

These bitwise logical operations use syntax equivalent to their Macaulay2
counterparts.

See ~ (Macaulay2Doc), is bitwise not, calling R's bitwNot.

+----------------------------+
|i1 : x = RObject 12         |
|                            |
|o1 = [1] 12                 |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : y = RObject 10         |
|                            |
|o2 = [1] 10                 |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : x~                     |
|                            |
|o3 = [1] -13                |
|                            |
|o3 : RObject of type integer|
+----------------------------+

See & (Macaulay2Doc), is bitwise and, calling R's bitwAnd.

+----------------------------+
|i4 : x & y                  |
|                            |
|o4 = [1] 8                  |
|                            |
|o4 : RObject of type integer|
+----------------------------+

See | (Macaulay2Doc), is bitwise or, calling R's bitwOr.

+----------------------------+
|i5 : x | y                  |
|                            |
|o5 = [1] 14                 |
|                            |
|o5 : RObject of type integer|
+----------------------------+

See ^^ (Macaulay2Doc), is bitwise xor, calling R's bitwXor.

+----------------------------+
|i6 : x ^^ y                 |
|                            |
|o6 = [1] 6                  |
|                            |
|o6 : RObject of type integer|
+----------------------------+

See << (Macaulay2Doc), and >> (Macaulay2Doc), are the bitwise
shift operators, calling R's bitwShiftL and bitwShiftR, respectively.

+----------------------------+
|i7 : x << y                 |
|                            |
|o7 = [1] 12288              |
|                            |
|o7 : RObject of type integer|
+----------------------------+
|i8 : oo >> y                |
|                            |
|o8 = [1] 12                 |
|                            |
|o8 : RObject of type integer|
+----------------------------+

For the binary operators, one of the operands may be a Macaulay2 object.  It
will be converted to an RObject, before the operation is
performed.

+-----------------------------+
|i9 : x & 10                  |
|                             |
|o9 = [1] 8                   |
|                             |
|o9 : RObject of type integer |
+-----------------------------+
|i10 : 12 | y                 |
|                             |
|o10 = [1] 14                 |
|                             |
|o10 : RObject of type integer|
+-----------------------------+

extract or replace parts of RObjects -- extract or replace parts of R objects
*****************************************************************************

To extract a single element of an RObject, use an underscore,
which calls R's [[ operator.  Note that R uses one-based indexing.

+------------------------------------------+
|i1 : x = RObject toList(5..15)            |
|                                          |
|o1 =  [1]  5  6  7  8  9 10 11 12 13 14 15|
|                                          |
|o1 : RObject of type integer              |
+------------------------------------------+
|i2 : x_1                                  |
|                                          |
|o2 = [1] 5                                |
|                                          |
|o2 : RObject of type integer              |
+------------------------------------------+

To extract multiple elements, use square brackets.  This calls R's [ operator.

+----------------------------+
|i3 : x[1, 4..8]             |
|                            |
|o3 = [1]  5  8  9 10 11 12  |
|                            |
|o3 : RObject of type integer|
+----------------------------+

Parts of an R object may be replaced as well.  This only affects the return
value.  The original object is not modified.

+------------------------------------------+
|i4 : x_1 = 3                              |
|                                          |
|o4 =  [1]  3  6  7  8  9 10 11 12 13 14 15|
|                                          |
|o4 : RObject of type integer              |
+------------------------------------------+
|i5 : x[1..4, 8] = {1, 2, 3, 4, 5}         |
|                                          |
|o5 =  [1]  1  2  3  4  9 10 11  5 13 14 15|
|                                          |
|o5 : RObject of type integer              |
+------------------------------------------+
|i6 : x                                    |
|                                          |
|o6 =  [1]  5  6  7  8  9 10 11 12 13 14 15|
|                                          |
|o6 : RObject of type integer              |
+------------------------------------------+

functions on RObjects representing complex numbers -- functions on R objects representing complex numbers
*********************************************************************************************************

The methods conjugate (Macaulay2Doc), imaginaryPart (Macaulay2Doc),
and realPart (Macaulay2Doc), are
overloaded to call R's Conj, Im, and Re functions to return the complex
conjugate, imaginary part, and real part respectively, of a given
RObject, representing a complex number

+----------------------------+
|i1 : z = RObject(3 + 2*ii)  |
|                            |
|o1 = [1] 3+2i               |
|                            |
|o1 : RObject of type complex|
+----------------------------+
|i2 : conjugate z            |
|                            |
|o2 = [1] 3-2i               |
|                            |
|o2 : RObject of type complex|
+----------------------------+
|i3 : realPart z             |
|                            |
|o3 = [1] 3                  |
|                            |
|o3 : RObject of type double |
+----------------------------+
|i4 : imaginaryPart z        |
|                            |
|o4 = [1] 2                  |
|                            |
|o4 : RObject of type double |
+----------------------------+

hyperbolic functions on RObjects -- hyperbolic functions on R objects
*********************************************************************

These functions call R's corresponding hyperbolic functions.

+---------------------------+
|i1 : cosh RObject 0        |
|                           |
|o1 = [1] 1                 |
|                           |
|o1 : RObject of type double|
+---------------------------+
|i2 : asinh RObject(3/4)    |
|                           |
|o2 = [1] 0.6931472         |
|                           |
|o2 : RObject of type double|
+---------------------------+

iterator(RObject) -- iterate through an R object
************************************************

Synopsis
========

  * Function: iterator (Macaulay2Doc),
  * Usage:
        iterator x
  * Inputs:
      * x, a R object,
  * Outputs:
      * an iterator (Macaulay2Doc),

Description
===========

This returns an Iterator (Macaulay2Doc), object that may be used
to iterate through x.

+-------------------------------------------------+
|i1 : i = iterator (RSymbol "iris")_"Petal.Length"|
|                                                 |
|o1 = i                                           |
|                                                 |
|o1 : Iterator                                    |
+-------------------------------------------------+
|i2 : next i                                      |
|                                                 |
|o2 = [1] 1.4                                     |
|                                                 |
|o2 : RObject of type double                      |
+-------------------------------------------------+
|i3 : next i                                      |
|                                                 |
|o3 = [1] 1.4                                     |
|                                                 |
|o3 : RObject of type double                      |
+-------------------------------------------------+
|i4 : next i                                      |
|                                                 |
|o4 = [1] 1.3                                     |
|                                                 |
|o4 : RObject of type double                      |
+-------------------------------------------------+

Ways to use this method:
========================

  * iterator(RObject) -- iterate through an R
    object

length(RObject) -- the length of an R object
********************************************

Synopsis
========

  * Function: length (Macaulay2Doc),
  * Usage:
        length x
  * Inputs:
      * x, a R object,
  * Outputs:
      * an integer (Macaulay2Doc),

Description
===========

This function returns the length of an RObject.

+-------------------------------------------+
|i1 : length (RSymbol "iris")_"Petal.Length"|
|                                           |
|o1 = 150                                   |
+-------------------------------------------+

Ways to use this method:
========================

  * length(RObject) -- the length of an R object

library -- load an R package
****************************

Synopsis
========

  * Usage:
        library pkg
  * Inputs:
      * pkg, a string (Macaulay2Doc),

Description
===========

This loads an R package.  It is an RFunction, that calls R's
library function.

For example, suppose we want to load the abbey dataset with nickel content in a
Canadian syenite rock.  It is available in the MASS package.

+-----------------------------------------------------------------------------+
|i1 : library "MASS"                                                          |
|                                                                             |
|o1 = [1] "MASS"      "stats"     "graphics"  "grDevices" "utils"             |
|     [7] "methods"   "base"                                                  |
|                                                                             |
|o1 : RObject of type character                                               |
|-----------------------------------------------------------------------------|
|"datasets"                                                                   |
+-----------------------------------------------------------------------------+
|i2 : RSymbol "abbey"                                                         |
|                                                                             |
|o2 =  [1]   5.2   6.5   6.9   7.0   7.0   7.0   7.4   8.0   8.0   8.0   8.0  |
|     [13]   9.0   9.0  10.0  11.0  11.0  12.0  12.0  13.7  14.0  14.0  14.0  |
|     [25]  17.0  17.0  18.0  24.0  28.0  34.0 125.0                          |
|                                                                             |
|o2 : RObject of type double                                                  |
|-----------------------------------------------------------------------------|
| 8.5                                                                         |
|16.0                                                                         |
+-----------------------------------------------------------------------------+

For the programmer
==================

The object library, is an instance of the type RFunction.

logarithmic and exponential functions on RObjects -- logarithmic and exponential functions on R objects
*******************************************************************************************************

These functions do the expected thing when passed an RObject.

+---------------------------+
|i1 : exp RObject 1         |
|                           |
|o1 = [1] 2.718282          |
|                           |
|o1 : RObject of type double|
+---------------------------+
|i2 : log RObject exp 2     |
|                           |
|o2 = [1] 2                 |
|                           |
|o2 : RObject of type double|
+---------------------------+

logical operators on RObjects -- logical operators on R objects
***************************************************************

The logical operators not (Macaulay2Doc), and (Macaulay2Doc),
see or (Macaulay2Doc), and xor (Macaulay2Doc),
are supported when working with logical vectors.

+-----------------------------------+
|i1 : not RObject true              |
|                                   |
|o1 = [1] FALSE                     |
|                                   |
|o1 : RObject of type logical       |
+-----------------------------------+
|i2 : RObject true and RObject false|
|                                   |
|o2 = [1] FALSE                     |
|                                   |
|o2 : RObject of type logical       |
+-----------------------------------+
|i3 : RObject true or RObject false |
|                                   |
|o3 = [1] TRUE                      |
|                                   |
|o3 : RObject of type logical       |
+-----------------------------------+
|i4 : RObject true xor RObject false|
|                                   |
|o4 = [1] TRUE                      |
|                                   |
|o4 : RObject of type logical       |
+-----------------------------------+

When a logical vector contains multiple elements, the output will also contain
multiple elements.

+-----------------------------------------------------------------------------+
|i5 : RObject {true, true, false, false} and RObject {true, false, true,      |
|                                                                             |
|o5 = [1]  TRUE FALSE FALSE FALSE                                             |
|                                                                             |
|o5 : RObject of type logical                                                 |
|-----------------------------------------------------------------------------|
|false}                                                                       |
+-----------------------------------------------------------------------------+

For the binary operators, one of the operands may be a Macaulay2 object.  It
will be converted to an RObject, before the operation is
performed.

+----------------------------------------------------------------------+
|i6 : RObject {true, true, false, false} or {true, false, true, false} |
|                                                                      |
|o6 = [1]  TRUE  TRUE  TRUE FALSE                                      |
|                                                                      |
|o6 : RObject of type logical                                          |
+----------------------------------------------------------------------+
|i7 : {true, true, false, false} xor RObject {true, false, true, false}|
|                                                                      |
|o7 = [1] FALSE  TRUE  TRUE FALSE                                      |
|                                                                      |
|o7 : RObject of type logical                                          |
+----------------------------------------------------------------------+

Note that and (Macaulay2Doc), and or (Macaulay2Doc), use R's
& and |, respectively.

maxima and minima of RObjects -- maxima and minima of R objects
***************************************************************

These functions do the expected thing when passed an RObject.

+----------------------------+
|i1 : x = RObject {1, 3, 5}  |
|                            |
|o1 = [1] 1 3 5              |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : max x                  |
|                            |
|o2 = [1] 5                  |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : min x                  |
|                            |
|o3 = [1] 1                  |
|                            |
|o3 : RObject of type integer|
+----------------------------+

miscellaneous mathematical functions on RObjects -- miscellaneous mathematical functions on R objects
*****************************************************************************************************

When passed an RObject, abs (Macaulay2Doc), and
sqrt (Macaulay2Doc), do the expected thing, calling the corresponding R
functions to compute the absolute value and square root of the given input,
respectively.

+----------------------------+
|i1 : x = RObject(-2)        |
|                            |
|o1 = [1] -2                 |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : abs x                  |
|                            |
|o2 = [1] 2                  |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : sqrt oo                |
|                            |
|o3 = [1] 1.414214           |
|                            |
|o3 : RObject of type double |
+----------------------------+

NA -- missing value
*******************

Description
===========

NA is an RObject, indicating a missing value.  It is a logical
vector of length 1.

+----------------------------+
|i1 : NA                     |
|                            |
|o1 = [1] NA                 |
|                            |
|o1 : RObject of type logical|
+----------------------------+

For the programmer
==================

The object NA, is a R object.

product(RObject) -- product of R object
***************************************

Synopsis
========

  * Function: product (Macaulay2Doc),
  * Usage:
        product x
  * Inputs:
      * x, a R object,
  * Outputs:
      * a R object,

Description
===========

This function returns the product of all the values present in x. It wraps
around R's prod function.

+----------------------------+
|i1 : x = RObject {2, 4, 6}  |
|                            |
|o1 = [1] 2 4 6              |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : product x              |
|                            |
|o2 = [1] 48                 |
|                            |
|o2 : RObject of type double |
+----------------------------+

Ways to use this method:
========================

  * product(RObject) -- product of R object

relational operators on RObjects -- relational operators on R objects
*********************************************************************

The relational operators == (Macaulay2Doc), != (Macaulay2Doc),
see > (Macaulay2Doc), < (Macaulay2Doc),
>= (Macaulay2Doc), and <= (Macaulay2Doc), do the expected thing
when comparing two RObject,'s.

+----------------------------+
|i1 : x = RObject 5          |
|                            |
|o1 = [1] 5                  |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : y = RObject 2          |
|                            |
|o2 = [1] 2                  |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : x == y                 |
|                            |
|o3 = false                  |
+----------------------------+
|i4 : x != y                 |
|                            |
|o4 = true                   |
+----------------------------+
|i5 : x > y                  |
|                            |
|o5 = true                   |
+----------------------------+
|i6 : x < y                  |
|                            |
|o6 = false                  |
+----------------------------+
|i7 : x >= y                 |
|                            |
|o7 = true                   |
+----------------------------+
|i8 : x < y                  |
|                            |
|o8 = false                  |
+----------------------------+

One of the operands may be a Macaulay2 object.  It will be converted to an
RObject, before the operation is performed.

+-----------+
|i9 : x > 2 |
|           |
|o9 = true  |
+-----------+
|i10 : 5 < y|
|           |
|o10 = false|
+-----------+

Note that these operators return Macaulay2 Boolean (Macaulay2Doc),
objects and not R logical vectors.  In particular, they
are not useful for comparing vectors of length greater than 1.  To do this, you
may use RFunction, to get the corresponding R operator as a
function.

+--------------------------------------------+
|i11 : (RFunction ">=")({1, 2, 3}, {2, 2, 2})|
|                                            |
|o11 = [1] FALSE  TRUE  TRUE                 |
|                                            |
|o11 : RObject of type logical               |
+--------------------------------------------+

RFunction -- R function
***********************

Synopsis
========

  * Usage:
        RFunction x
  * Inputs:
      * x, a string (Macaulay2Doc), specifying an R function;
  * Outputs:
      * an instance of the type RFunction,

Description
===========

An RFunction is a function that wraps around an R function specified by a
string.  Its arguments are converted to RObject,'s.

+----------------------------------------+
|i1 : qnorm = RFunction "qnorm"          |
|                                        |
|o1 = qnorm                              |
|                                        |
|o1 : RFunction                          |
+----------------------------------------+
|i2 : qnorm(0.025, "lower.tail" => false)|
|                                        |
|o2 = [1] 1.959964                       |
|                                        |
|o2 : RObject of type double             |
+----------------------------------------+

Methods that use an object of class RFunction:
==============================================

  * "new RFunction from RObject"
  * "new RFunction from String"

For the programmer
==================

The object RFunction, is a self initializing type (Macaulay2Doc),
with ancestor classes
FunctionClosure (Macaulay2Doc), < Function (Macaulay2Doc)
< Thing (Macaulay2Doc).

RObject -- R object
*******************

Synopsis
========

  * Usage:
        RObject x
  * Inputs:
      * x, a thing (Macaulay2Doc), a Macaulay2 object;
  * Outputs:
      * a R object, the R equivalent of x;

Description
===========

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

RObject is a SelfInitializingType (Macaulay2Doc),
and so it acts as its own constructor method.  When passed a Macaulay2 object
as input, the corresponding R object is returned.

See Nothing (Macaulay2Doc), inputs return R's NULL.

+-------------------------+
|i1 : RObject null        |
|                         |
|o1 = NULL                |
|                         |
|o1 : RObject of type NULL|
+-------------------------+

See Boolean (Macaulay2Doc), inputs return logical vectors.

+----------------------------+
|i2 : RObject true           |
|                            |
|o2 = [1] TRUE               |
|                            |
|o2 : RObject of type logical|
+----------------------------+

Another logical vector without a Macaulay2 equivalent is NA.

+----------------------------+
|i3 : NA                     |
|                            |
|o3 = [1] NA                 |
|                            |
|o3 : RObject of type logical|
+----------------------------+

See ZZ (Macaulay2Doc), inputs return integer vectors.

+----------------------------+
|i4 : RObject 1              |
|                            |
|o4 = [1] 1                  |
|                            |
|o4 : RObject of type integer|
+----------------------------+

See RR (Macaulay2Doc), (and QQ (Macaulay2Doc)) inputs return
double vectors.

+---------------------------+
|i5 : RObject pi            |
|                           |
|o5 = [1] 3.141593          |
|                           |
|o5 : RObject of type double|
+---------------------------+

See CC (Macaulay2Doc), inputs return complex vectors.

+----------------------------+
|i6 : RObject ii             |
|                            |
|o6 = [1] 0+1i               |
|                            |
|o6 : RObject of type complex|
+----------------------------+

See String (Macaulay2Doc), (and Symbol (Macaulay2Doc))
inputs return character vectors.

+------------------------------+
|i7 : RObject "Hello, world!"  |
|                              |
|o7 = [1] "Hello, world!"      |
|                              |
|o7 : RObject of type character|
+------------------------------+
|i8 : RObject foo              |
|                              |
|o8 = [1] "foo"                |
|                              |
|o8 : RObject of type character|
+------------------------------+

With a List (Macaulay2Doc), input, the type of the output depends on
the elements of the list.  The R function c is used to combine the elements
into a vector.

+---------------------------------------------------------+
|i9 : RObject {true, false, true, false}                  |
|                                                         |
|o9 = [1]  TRUE FALSE  TRUE FALSE                         |
|                                                         |
|o9 : RObject of type logical                             |
+---------------------------------------------------------+
|i10 : RObject {2, 4, 6, 8, 10}                           |
|                                                         |
|o10 = [1]  2  4  6  8 10                                 |
|                                                         |
|o10 : RObject of type integer                            |
+---------------------------------------------------------+
|i11 : RObject {0, 1/2, exp 1}                            |
|                                                         |
|o11 = [1] 0.000000 0.500000 2.718282                     |
|                                                         |
|o11 : RObject of type double                             |
+---------------------------------------------------------+
|i12 : RObject apply(3, k -> exp(2*k*pi*ii/3))            |
|                                                         |
|o12 = [1]  1.0+0.0000000i -0.5+0.8660254i -0.5-0.8660254i|
|                                                         |
|o12 : RObject of type complex                            |
+---------------------------------------------------------+
|i13 : RObject {"foo", "bar", "baz"}                      |
|                                                         |
|o13 = [1] "foo" "bar" "baz"                              |
|                                                         |
|o13 : RObject of type character                          |
+---------------------------------------------------------+

When a Sequence (Macaulay2Doc), is given as input, a pairlist, a
linked list type used by R for function arguments, is returned.

+------------------------------+
|i14 : RObject (2, 3, 5)       |
|                              |
|o14 = [[1]]                   |
|      [1] 2                   |
|                              |
|      [[2]]                   |
|      [1] 3                   |
|                              |
|      [[3]]                   |
|      [1] 5                   |
|                              |
|                              |
|o14 : RObject of type pairlist|
+------------------------------+

When a List (Macaulay2Doc), or Sequence (Macaulay2Doc),
is given as input and any of its elements are
Option (Macaulay2Doc), objects, then the keys are used as names by R.

+----------------------------------+
|i15 : RObject {foo => 1, bar => 2}|
|                                  |
|o15 = foo bar                     |
|        1   2                     |
|                                  |
|o15 : RObject of type integer     |
+----------------------------------+
|i16 : RObject (baz => 3, qux => 4)|
|                                  |
|o16 = $baz                        |
|      [1] 3                       |
|                                  |
|      $qux                        |
|      [1] 4                       |
|                                  |
|                                  |
|o16 : RObject of type pairlist    |
+----------------------------------+

When a Matrix (Macaulay2Doc), is given as input, an R matrix is
returned.

+-----------------------------+
|i17 : A = random(ZZ^2, ZZ^3) |
|                             |
|o17 = | 8 3 8 |              |
|      | 1 7 3 |              |
|                             |
|               2       3     |
|o17 : Matrix ZZ  <-- ZZ      |
+-----------------------------+
|i18 : RObject A              |
|                             |
|o18 =      [,1] [,2] [,3]    |
|      [1,]    8    3    8    |
|      [2,]    1    7    3    |
|                             |
|o18 : RObject of type integer|
+-----------------------------+

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

See also
========

  * arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * bitwise logical operations on RObjects
    -- bitwise logical operations on R objects
  * extract or replace parts of RObjects
    -- extract or replace parts of R objects
  * functions on RObjects representing complex numbers
    -- functions on R objects
    representing complex numbers
  * hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * logarithmic and exponential functions on RObjects
    -- logarithmic and exponential functions
    on R objects
  * logical operators on RObjects, --
    logical operators on R objects
  * maxima and minima of RObjects, --
    maxima and minima of R objects
  * miscellaneous mathematical functions on RObjects
    -- miscellaneous mathematical functions
    on R objects
  * relational operators on RObjects,
    -- relational operators on R objects
  * rounding of RObjects -- rounding of R objects
  * special mathematical functions on RObjects
    -- special mathematical functions on R objects
  * trigonometric functions on RObjects
    -- trigonometric functions on R objects

Methods that use a R object:
============================

  * ?? RObject (missing documentation)
  * "+ RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "- RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject % RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject % Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject * RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject * Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject + RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject + Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject - RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject - Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject / RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject / Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject // RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject // Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject ^ RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject ^ Thing" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing % RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing * RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing + RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing - RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing / RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing // RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "Thing ^ RObject" -- see arithmetic operators on RObjects,
    -- arithmetic operators on R objects
  * "RObject & RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject & Thing" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject << RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject << Thing" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject >> RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject >> Thing" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject ^^ RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject ^^ Thing" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject | RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject | Thing" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject ~" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R objects
  * "Thing & RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "Thing << RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "Thing >> RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "Thing ^^ RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "Thing | RObject" -- see bitwise logical operations on RObjects,
    -- bitwise logical operations on R
    objects
  * "RObject _ Thing" -- see extract or replace parts of RObjects,
    -- extract or replace parts of R
    objects
  * "RObject _ Thing = Thing" -- see extract or replace parts of RObjects,
    -- extract or replace parts
    of R objects
  * "RObject Array" -- see extract or replace parts of RObjects,
    -- extract or replace parts of R objects
  * "RObject SPACE Array = Thing" -- see extract or replace parts of RObjects,
    -- extract or replace parts
    of R objects
  * "conjugate(RObject)" -- see functions on RObjects representing complex numbers,
    --
    functions on R objects representing complex numbers
  * "imaginaryPart(RObject)" -- see functions on RObjects representing complex numbers,
    --
    functions on R objects representing complex numbers
  * "realPart(RObject)" -- see functions on RObjects representing complex numbers,
    -- functions
    on R objects representing complex numbers
  * "acosh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * "asinh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * "atanh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * "cosh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * "sinh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * "tanh(RObject)" -- see hyperbolic functions on RObjects,
    -- hyperbolic functions on R objects
  * iterator(RObject) -- iterate through an R
    object
  * length(RObject) -- the length of an R object
  * "exp(RObject)" -- see logarithmic and exponential functions on RObjects,
    -- logarithmic
    and exponential functions on R objects
  * "expm1(RObject)" -- see logarithmic and exponential functions on RObjects,
    -- logarithmic
    and exponential functions on R objects
  * "log(RObject)" -- see logarithmic and exponential functions on RObjects,
    -- logarithmic
    and exponential functions on R objects
  * "log1p(RObject)" -- see logarithmic and exponential functions on RObjects,
    -- logarithmic
    and exponential functions on R objects
  * "not RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject and RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject and Thing" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject or RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject or Thing" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject xor RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "RObject xor Thing" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "Thing and RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "Thing or RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "Thing xor RObject" -- see logical operators on RObjects,
    -- logical operators on R objects
  * "max(RObject)" -- see maxima and minima of RObjects,
    -- maxima and minima of R objects
  * "min(RObject)" -- see maxima and minima of RObjects,
    -- maxima and minima of R objects
  * "abs(RObject)" -- see miscellaneous mathematical functions on RObjects,
    --
    miscellaneous mathematical functions on R objects
  * "sqrt(RObject)" -- see miscellaneous mathematical functions on RObjects,
    --
    miscellaneous mathematical functions on R objects
  * product(RObject) -- product of R object
  * "RObject == RObject" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "RObject == Thing" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "RObject ? RObject" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "RObject ? Thing" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "Thing == RObject" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "Thing ? RObject" -- see relational operators on RObjects,
    -- relational operators on R objects
  * "new RFunction from RObject" -- see RFunction, -- R
    function
  * "net(RObject)"
  * "new RObject from Boolean"
  * "new RObject from CC"
  * "new RObject from List"
  * "new RObject from Matrix"
  * "new RObject from Nothing"
  * "new RObject from Number"
  * "new RObject from RR"
  * "new RObject from Sequence"
  * "new RObject from String"
  * "new RObject from Symbol"
  * "new RObject from ZZ"
  * "RObject .. RObject" -- see RObject _colon_ RObject,
    -- R colon operator
  * "RObject .. Thing" -- see RObject _colon_ RObject,
    -- R colon operator
  * RObject _colon_ RObject -- R colon operator
  * "RObject : Thing" -- see RObject _colon_ RObject,
    -- R colon operator
  * "Thing .. RObject" -- see RObject _colon_ RObject,
    -- R colon operator
  * "Thing : RObject" -- see RObject _colon_ RObject,
    -- R colon operator
  * "ceiling(RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "floor(RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "round(RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "round(RObject,RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "round(RObject,Thing)" -- see rounding of RObjects,
    -- rounding of R objects
  * "round(Thing,RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "truncate(RObject)" -- see rounding of RObjects,
    -- rounding of R objects
  * "Beta(RObject,RObject)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "Beta(RObject,Thing)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "Beta(Thing,RObject)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "binomial(RObject,RObject)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "binomial(RObject,Thing)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "binomial(Thing,RObject)" -- see special mathematical functions on RObjects,
    -- special
    mathematical functions on R objects
  * "Digamma(RObject)" -- see special mathematical functions on RObjects,
    -- special mathematical
    functions on R objects
  * "Gamma(RObject)" -- see special mathematical functions on RObjects,
    -- special mathematical
    functions on R objects
  * "lngamma(RObject)" -- see special mathematical functions on RObjects,
    -- special mathematical
    functions on R objects
  * "RObject !" -- see special mathematical functions on RObjects,
    -- special mathematical
    functions on R objects
  * sum(RObject) -- sum of R object
  * "acos(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "asin(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "atan(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "atan2(RObject,RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "atan2(RObject,Thing)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "atan2(Thing,RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "cos(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "sin(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * "tan(RObject)" -- see trigonometric functions on RObjects,
    -- trigonometric functions on R
    objects
  * value(RObject) -- convert R object to Macaulay2

For the programmer
==================

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

RObject : RObject -- R colon operator
*************************************

Synopsis
========

  * Operator: _colon_ (Macaulay2Doc),

Description
===========

Generate the sequence between two numbers with step size 1 (or -1 if the first
number is greater than the second).  This operator is available both as :, as
in R, or .., its Macaulay2 equivalent.

+----------------------------+
|i1 : x = RObject 2          |
|                            |
|o1 = [1] 2                  |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : y = RObject 7          |
|                            |
|o2 = [1] 7                  |
|                            |
|o2 : RObject of type integer|
+----------------------------+
|i3 : x:y                    |
|                            |
|o3 = [1] 2 3 4 5 6 7        |
|                            |
|o3 : RObject of type integer|
+----------------------------+
|i4 : y:x                    |
|                            |
|o4 = [1] 7 6 5 4 3 2        |
|                            |
|o4 : RObject of type integer|
+----------------------------+
|i5 : x..y                   |
|                            |
|o5 = [1] 2 3 4 5 6 7        |
|                            |
|o5 : RObject of type integer|
+----------------------------+

One of the operands may be a Macaulay2 object.  It will be converted to an
RObject, before the operation is performed. An exception is that
when using the : operator and the first argument given is a Macaulay2 ZZ (Macaulay2Doc),
object, see ZZ _colon_ Thing (Macaulay2Doc),
will be called instead.

+----------------------------+
|i6 : x:7                    |
|                            |
|o6 = [1] 2 3 4 5 6 7        |
|                            |
|o6 : RObject of type integer|
+----------------------------+
|i7 : 2:y                    |
|                            |
|o7 = ([1] 7, [1] 7)         |
|                            |
|o7 : Sequence               |
+----------------------------+
|i8 : 2..y                   |
|                            |
|o8 = [1] 2 3 4 5 6 7        |
|                            |
|o8 : RObject of type integer|
+----------------------------+

Ways to use this method:
========================

  * RObject _colon_ RObject -- R colon operator
  * "RObject : Thing"
  * "Thing : RObject"

rounding of RObjects -- rounding of R objects
*********************************************

These functions round RObject,'s representing numbers in
specific ways.

See ceiling (Macaulay2Doc), and floor (Macaulay2Doc), do
the expected thing, calling the corresponding R function to round up or down,
respectively.

+---------------------------+
|i1 : x = RObject exp 1     |
|                           |
|o1 = [1] 2.718282          |
|                           |
|o1 : RObject of type double|
+---------------------------+
|i2 : ceiling x             |
|                           |
|o2 = [1] 3                 |
|                           |
|o2 : RObject of type double|
+---------------------------+
|i3 : floor x               |
|                           |
|o3 = [1] 2                 |
|                           |
|o3 : RObject of type double|
+---------------------------+

See truncate (Macaulay2Doc), calls R's trunc function to round
toward 0.

+---------------------------+
|i4 : truncate x            |
|                           |
|o4 = [1] 2                 |
|                           |
|o4 : RObject of type double|
+---------------------------+
|i5 : truncate(-x)          |
|                           |
|o5 = [1] -2                |
|                           |
|o5 : RObject of type double|
+---------------------------+

See round (Macaulay2Doc), calls the corresponding R function, which
rounds to even, just as in Macaulay2.

+---------------------------+
|i6 : round RObject 2.5     |
|                           |
|o6 = [1] 2                 |
|                           |
|o6 : RObject of type double|
+---------------------------+
|i7 : round RObject 3.5     |
|                           |
|o7 = [1] 4                 |
|                           |
|o7 : RObject of type double|
+---------------------------+

It may also be called with a second argument, or equivalently, a digits option,
specifying the number of decimal places to be used when rounding.

+---------------------------+
|i8 : round(x, 2)           |
|                           |
|o8 = [1] 2.72              |
|                           |
|o8 : RObject of type double|
+---------------------------+
|i9 : round(x, digits => 3) |
|                           |
|o9 = [1] 2.718             |
|                           |
|o9 : RObject of type double|
+---------------------------+

RSymbol -- return an R object using its symbol name
***************************************************

Synopsis
========

  * Usage:
        RSymbol str
  * Inputs:
      * str, a string (Macaulay2Doc),
  * Outputs:
      * a R object,

Description
===========

Return an R object using its symbol name.  For example, this can be useful for
loading datasets.

+----------------------------------------------------------------------------+
|i1 : RSymbol "mtcars"                                                       |
|                                                                            |
|o1 =                      mpg cyl  disp  hp drat    wt  qsec vs am gear carb|
|     Mazda RX4           21.0   6 160.0 110 3.90 2.620 16.46  0  1    4    4|
|     Mazda RX4 Wag       21.0   6 160.0 110 3.90 2.875 17.02  0  1    4    4|
|     Datsun 710          22.8   4 108.0  93 3.85 2.320 18.61  1  1    4    1|
|     Hornet 4 Drive      21.4   6 258.0 110 3.08 3.215 19.44  1  0    3    1|
|     Hornet Sportabout   18.7   8 360.0 175 3.15 3.440 17.02  0  0    3    2|
|     Valiant             18.1   6 225.0 105 2.76 3.460 20.22  1  0    3    1|
|     Duster 360          14.3   8 360.0 245 3.21 3.570 15.84  0  0    3    4|
|     Merc 240D           24.4   4 146.7  62 3.69 3.190 20.00  1  0    4    2|
|     Merc 230            22.8   4 140.8  95 3.92 3.150 22.90  1  0    4    2|
|     Merc 280            19.2   6 167.6 123 3.92 3.440 18.30  1  0    4    4|
|     Merc 280C           17.8   6 167.6 123 3.92 3.440 18.90  1  0    4    4|
|     Merc 450SE          16.4   8 275.8 180 3.07 4.070 17.40  0  0    3    3|
|     Merc 450SL          17.3   8 275.8 180 3.07 3.730 17.60  0  0    3    3|
|     Merc 450SLC         15.2   8 275.8 180 3.07 3.780 18.00  0  0    3    3|
|     Cadillac Fleetwood  10.4   8 472.0 205 2.93 5.250 17.98  0  0    3    4|
|     Lincoln Continental 10.4   8 460.0 215 3.00 5.424 17.82  0  0    3    4|
|     Chrysler Imperial   14.7   8 440.0 230 3.23 5.345 17.42  0  0    3    4|
|     Fiat 128            32.4   4  78.7  66 4.08 2.200 19.47  1  1    4    1|
|     Honda Civic         30.4   4  75.7  52 4.93 1.615 18.52  1  1    4    2|
|     Toyota Corolla      33.9   4  71.1  65 4.22 1.835 19.90  1  1    4    1|
|     Toyota Corona       21.5   4 120.1  97 3.70 2.465 20.01  1  0    3    1|
|     Dodge Challenger    15.5   8 318.0 150 2.76 3.520 16.87  0  0    3    2|
|     AMC Javelin         15.2   8 304.0 150 3.15 3.435 17.30  0  0    3    2|
|     Camaro Z28          13.3   8 350.0 245 3.73 3.840 15.41  0  0    3    4|
|     Pontiac Firebird    19.2   8 400.0 175 3.08 3.845 17.05  0  0    3    2|
|     Fiat X1-9           27.3   4  79.0  66 4.08 1.935 18.90  1  1    4    1|
|     Porsche 914-2       26.0   4 120.3  91 4.43 2.140 16.70  0  1    5    2|
|     Lotus Europa        30.4   4  95.1 113 3.77 1.513 16.90  1  1    5    2|
|     Ford Pantera L      15.8   8 351.0 264 4.22 3.170 14.50  0  1    5    4|
|     Ferrari Dino        19.7   6 145.0 175 3.62 2.770 15.50  0  1    5    6|
|     Maserati Bora       15.0   8 301.0 335 3.54 3.570 14.60  0  1    5    8|
|     Volvo 142E          21.4   4 121.0 109 4.11 2.780 18.60  1  1    4    2|
|                                                                            |
|o1 : RObject of type list                                                   |
+----------------------------------------------------------------------------+

For R functions, use RFunction, instead.

Ways to use RSymbol:
====================

  * "RSymbol(String)"

For the programmer
==================

The object RSymbol, is a method function (Macaulay2Doc).

special mathematical functions on RObjects -- special mathematical functions on R objects
*****************************************************************************************

When at least one of its arguments is an RObject, Beta (Macaulay2Doc),
calls R's beta function.

+-------------------------------+
|i1 : Beta(RObject 1, RObject 2)|
|                               |
|o1 = [1] 0.5                   |
|                               |
|o1 : RObject of type double    |
+-------------------------------+

See Gamma (Macaulay2Doc), lngamma (Macaulay2Doc), and
Digamma (Macaulay2Doc), call R's gamma, lgamma, and digamma,
respectively, when passed an RObject.

+---------------------------+
|i2 : Gamma RObject 2       |
|                           |
|o2 = [1] 1                 |
|                           |
|o2 : RObject of type double|
+---------------------------+
|i3 : lngamma RObject 2     |
|                           |
|o3 = [1] 0                 |
|                           |
|o3 : RObject of type double|
+---------------------------+
|i4 : Digamma RObject 2     |
|                           |
|o4 = [1] 0.4227843         |
|                           |
|o4 : RObject of type double|
+---------------------------+

See binomial (Macaulay2Doc), calls R's choose when one of its
arguments is an RObject, and the postfix operator ! (Macaulay2Doc),
calls R's factorial when passed an RObject.

+-----------------------------------+
|i5 : binomial(RObject 4, RObject 2)|
|                                   |
|o5 = [1] 6                         |
|                                   |
|o5 : RObject of type double        |
+-----------------------------------+
|i6 : (RObject 3)!                  |
|                                   |
|o6 = [1] 6                         |
|                                   |
|o6 : RObject of type double        |
+-----------------------------------+

sum(RObject) -- sum of R object
*******************************

Synopsis
========

  * Function: sum (Macaulay2Doc),
  * Usage:
        sum x
  * Inputs:
      * x, a R object,
  * Outputs:
      * a R object,

Description
===========

This function returns the sum of all the values present in x. It wraps around
R's sum function.

+----------------------------+
|i1 : x = RObject {2, 4, 6}  |
|                            |
|o1 = [1] 2 4 6              |
|                            |
|o1 : RObject of type integer|
+----------------------------+
|i2 : sum x                  |
|                            |
|o2 = [1] 12                 |
|                            |
|o2 : RObject of type integer|
+----------------------------+

Ways to use this method:
========================

  * sum(RObject) -- sum of R object

trigonometric functions on RObjects -- trigonometric functions on R objects
***************************************************************************

These functions call R's corresponding trigonometric functions.

+---------------------------+
|i1 : cos RObject pi        |
|                           |
|o1 = [1] -1                |
|                           |
|o1 : RObject of type double|
+---------------------------+
|i2 : asin RObject 1        |
|                           |
|o2 = [1] 1.570796          |
|                           |
|o2 : RObject of type double|
+---------------------------+

For atan2, one of the operands may be a Macaulay2 object.  It will be converted
to an RObject, before the operation is performed.

+-----------------------------+
|i3 : atan2(RObject 1, -1)    |
|                             |
|o3 = [1] 2.356194            |
|                             |
|o3 : RObject of type double  |
+-----------------------------+
|i4 : atan2(sqrt 3, RObject 1)|
|                             |
|o4 = [1] 1.047198            |
|                             |
|o4 : RObject of type double  |
+-----------------------------+

value(RObject) -- convert R object to Macaulay2
***********************************************

Synopsis
========

  * Function: value (Macaulay2Doc),
  * Usage:
        value x
  * Inputs:
      * x, a R object,
  * Outputs:
      * a thing (Macaulay2Doc), the Macaulay2 equivalent of x;

Description
===========

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, see null (Macaulay2Doc), is returned.

+-------------------------+
|i1 : x = RObject null    |
|                         |
|o1 = NULL                |
|                         |
|o1 : RObject of type NULL|
+-------------------------+
|i2 : value x === null    |
|                         |
|o2 = true                |
+-------------------------+

When the input is a logical vector, a Boolean (Macaulay2Doc), is
returned.

+----------------------------+
|i3 : x = RObject true       |
|                            |
|o3 = [1] TRUE               |
|                            |
|o3 : RObject of type logical|
+----------------------------+
|i4 : value x                |
|                            |
|o4 = true                   |
+----------------------------+

When the input is an integer vector, a ZZ (Macaulay2Doc), object is
returned.

+----------------------------+
|i5 : x = RObject 5          |
|                            |
|o5 = [1] 5                  |
|                            |
|o5 : RObject of type integer|
+----------------------------+
|i6 : value x                |
|                            |
|o6 = 5                      |
+----------------------------+

When the input is a double vector, a RR (Macaulay2Doc), object is
returned.

+---------------------------+
|i7 : x = RObject (3/2)     |
|                           |
|o7 = [1] 1.5               |
|                           |
|o7 : RObject of type double|
+---------------------------+
|i8 : value x               |
|                           |
|o8 = 1.5                   |
|                           |
|o8 : RR (of precision 53)  |
+---------------------------+

When the input is a complex vector, a CC (Macaulay2Doc), object is
returned.

+----------------------------+
|i9 : x = RObject ii         |
|                            |
|o9 = [1] 0+1i               |
|                            |
|o9 : RObject of type complex|
+----------------------------+
|i10 : value x               |
|                            |
|o10 = ii                    |
|                            |
|o10 : CC (of precision 53)  |
+----------------------------+

When the input is a character vector, a String (Macaulay2Doc),
object is returned.

+-------------------------------+
|i11 : x = RObject foo          |
|                               |
|o11 = [1] "foo"                |
|                               |
|o11 : RObject of type character|
+-------------------------------+
|i12 : value x                  |
|                               |
|o12 = foo                      |
+-------------------------------+

When the input is a vector with more than one element, a List (Macaulay2Doc),
object is returned.

+------------------------------+
|i13 : x = RObject {1, 3, 5, 7}|
|                              |
|o13 = [1] 1 3 5 7             |
|                              |
|o13 : RObject of type integer |
+------------------------------+
|i14 : value x                 |
|                              |
|o14 = {1, 3, 5, 7}            |
|                              |
|o14 : List                    |
+------------------------------+

When the input is a pairlist (R's linked list type), a Sequence (Macaulay2Doc),
is returned.

+------------------------------+
|i15 : x = RObject (3, 6, 9)   |
|                              |
|o15 = [[1]]                   |
|      [1] 3                   |
|                              |
|      [[2]]                   |
|      [1] 6                   |
|                              |
|      [[3]]                   |
|      [1] 9                   |
|                              |
|                              |
|o15 : RObject of type pairlist|
+------------------------------+
|i16 : value x                 |
|                              |
|o16 = (3, 6, 9)               |
|                              |
|o16 : Sequence                |
+------------------------------+

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 (Macaulay2Doc), object is returned.

+------------------------------+
|i17 : RList = RFunction "list"|
|                              |
|o17 = RList                   |
|                              |
|o17 : RFunction               |
+------------------------------+
|i18 : x = RList(2, 4, 6, 8)   |
|                              |
|o18 = [[1]]                   |
|      [1] 2                   |
|                              |
|      [[2]]                   |
|      [1] 4                   |
|                              |
|      [[3]]                   |
|      [1] 6                   |
|                              |
|      [[4]]                   |
|      [1] 8                   |
|                              |
|                              |
|o18 : RObject of type list    |
+------------------------------+
|i19 : value x                 |
|                              |
|o19 = {2, 4, 6, 8}            |
|                              |
|o19 : List                    |
+------------------------------+

When the input is a matrix or array, a nested List (Macaulay2Doc),
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.

+------------------------------+
|i20 : A = random(ZZ^2, ZZ^3)  |
|                              |
|o20 = | 8 3 8 |               |
|      | 1 7 3 |               |
|                              |
|               2       3      |
|o20 : Matrix ZZ  <-- ZZ       |
+------------------------------+
|i21 : x = RObject A           |
|                              |
|o21 =      [,1] [,2] [,3]     |
|      [1,]    8    3    8     |
|      [2,]    1    7    3     |
|                              |
|o21 : RObject of type integer |
+------------------------------+
|i22 : value x                 |
|                              |
|o22 = {{8, 1}, {3, 7}, {8, 3}}|
|                              |
|o22 : List                    |
+------------------------------+
|i23 : A == transpose matrix oo|
|                              |
|o23 = true                    |
+------------------------------+

When the input has any names, the elements with names are returned as
Option (Macaulay2Doc), objects.

+-----------------------------------------+
|i24 : x = RObject {foo => 1, 2, bar => 3}|
|                                         |
|o24 = foo     bar                        |
|        1   2   3                        |
|                                         |
|o24 : RObject of type integer            |
+-----------------------------------------+
|i25 : value x                            |
|                                         |
|o25 = {foo => 1, 2, bar => 3}            |
|                                         |
|o25 : List                               |
+-----------------------------------------+

Ways to use this method:
========================

  * value(RObject) -- convert R object to Macaulay2