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

RFunction -- R function

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

Any Macaulay2 object may also be used; it is converted to a string with toString.

i3 : RFunction sin

o3 = RFunction[../RInterface.m2:145:4-150:15]

o3 : RFunction
i4 : oo(pi/4)

o4 = [1] 0.7071068

o4 : RObject of type double

Menu

Methods that use an object of class RFunction:

  • new RFunction from RObject
  • new RFunction from String
  • new RFunction from Thing

For the programmer

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


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/RInterface/doc/functions.m2:32:0.