Macaulay2 » Documentation
Packages » RInterface » RContext » new RContext from String
next | previous | forward | backward | up | index | toc

new RContext from String -- construct an R context

Description

Pass an R code string to initialize the context with variable bindings:

i1 : ctx = RContext "x <- 5L; y <- x^2L"

o1 = ctx

o1 : RContext
i2 : ctx_"x"

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

o2 = 5

o2 : RObject of type integer
i3 : ctx_"y"

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

o3 = 25

o3 : RObject of type double

Ways to use this method:


The source of this document is in RInterface/doc/context.m2:48:0.