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

RContext String -- evaluate R code in a context

Description

Evaluates R code in the R environment associated with the context. Variable assignments persist across calls.

i1 : ctx = new RContext

o1 = ctx

o1 : RContext
i2 : ctx "x <- 5L"

o2 = [1] 5

o2 : RObject of type integer
i3 : ctx "y <- x + 1L"

o3 = [1] 6

o3 : RObject of type integer
i4 : ctx "y"

o4 = [1] 6

o4 : RObject of type integer

Ways to use this method:


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