Documentation
¶
Overview ¶
Package rcells runs the R cells of a notebook. The generated program of a notebook with R cells imports it and gives each cell to one Session, a go-embedded-r interpreter whose global environment persists from cell to cell, as the Ruby cells share one interpreter.
It is linked only into a worker that has R cells: the packages that analyse, generate and drive notebooks (analysis, gen, kernel) do not import go-embedded-r's evaluator, and TestNoEvaluatorImport keeps it so.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WarningText ¶
WarningText is how R prints its warnings at the end of a cell. One warning is "Warning message:" and a line, several are "Warning messages:" and a numbered line each; a warning with a call reads "In call : message", one without it just the message. After an error R says "In addition: " first. The empty string is no warning.
Types ¶
type Cell ¶
type Cell struct {
Source string
}
Cell is one R cell as the generated program hands it over.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the R interpreter of one notebook. Its calls are serialised: an eval.Session is not safe for concurrent use.
func New ¶
func New() *Session
New makes a session with the limits the kernel set in the worker's environment (runtime.RLimitsEnv), or runtime.DefaultRLimits.
func (*Session) Run ¶
Run evaluates a cell. What it prints goes to the worker's standard output, what it writes to standard error and its warnings, in R's "Warning message:" form, to the standard error; the value of the last expression, when R would print it, is already in the output. An error fails the cell, with R's "Error in <call> : <message>".