nuget server logo nuget api documents
↑

API Docs / REnv / RInterpreter

RInterpreter

Full name SMRUCC.Rsharp.Interpreter.RInterpreter Assembly REnv Members 40

01 Syntax

SMRUCC.Rsharp.Interpreter.RInterpreter

02 Methods

NameOverloadsSummary
.ctor 1 直接无参数调用这个构造函数,则会使用默认的配置文件创建R#脚本解释器引擎实例
getDataStream 1 open the data file as stream from a given package with a specific resource reference name.
Print 2
Inspect 1 do call str function for inspect the structure of the given obj
Imports 1 imports {pkgs} from "baseDll";
LoadLibrary 2 Load packages from package name or dll module file
Add 2
Set 1 declare new variable or set variable value
Invoke 2 invoke a R function by name
Evaluate 2
InitializeEnvironment 1
RunInternal 1
Source 1 Run R# script program from a given script file.
FromEnvironmentConfiguration 1
SetTaskCancelHook 1
RedirectOutput 1
options 1
PrintMemory 1
Run 1
Parse 1
Dispose 1
op_Explicit 1

03 Properties

NameOverloadsSummary
globalEnvir 1 Global runtime environment.
debug 1 R# running in debug mode.
redirectError2stdout 1 是否重定向错误消息输出至RInterpreter.RedirectOutput())函数所定义的输出设备之中
strict 1 是否在严格模式下运行R#脚本?默认为严格模式,即: 1.
GetValue 1 Get value of a Symbol
globalSymbols 1 get all symbols inside the global environment
Rsharp 1 Default R# script interpreter which is created on the default environment.
warnings 1
silent 1
verbose 1
configFile 1
isExecCancel 1

04 Fields

NameOverloadsSummary
lastVariableName 1

05 Members

method .ctor #
#ctor(Options, String)

直接无参数调用这个构造函数,则会使用默认的配置文件创建R#脚本解释器引擎实例

Parameters
NameTypeDescription
envirConfOptions

-

method getDataStream #
getDataStream(String, String)

open the data file as stream from a given package with a specific resource reference name.

Parameters
NameTypeDescription
dataNameString

-

packageString

-

method Print overload 2 #
Print(String, Boolean)

A shortcut of print(expr)

Parameters
NameTypeDescription
exprString

-

autoBoolean

在自动条件下,会忽略掉expr为invisible 的结果打印

method Inspect #
Inspect(Object)

do call str function for inspect the structure of the given obj

Parameters
NameTypeDescription
objObject

-

method Imports #
Imports(String(), String)

imports {pkgs} from "baseDll";

Remarks

attach_lib_dir

Parameters
NameTypeDescription
pkgsString()

-

baseDllString

-

method LoadLibrary #
LoadLibrary(String, Boolean, Boolean)

Load packages from package name or dll module file

Parameters
NameTypeDescription
packageNameString

package namespace or dll module file path

method LoadLibrary overload 2 #
LoadLibrary(Type)

Imports static api function from given package module

Parameters
NameTypeDescription
packageType

-

method Add overload 2 #
Add(String, Object, TypeCodes)

Create a new symbol inside the R# runtime environment

Parameters
NameTypeDescription
name$String

-

valueObject

-

typeTypeCodes

-

method Set #
Set(String, Object)

declare new variable or set variable value

Parameters
NameTypeDescription
nameString

-

valueObject

-

method Invoke overload 2 #
Invoke(String, Object())

direct invoke

Parameters
NameTypeDescription
funcNameString

the function name, can be prefixed with the package namespace

argsObject()

the argument without names, this function will pass the argument value to target R# function directly with aligned with the function argument list.

method Invoke #
Invoke(String, NamedValue(Of Object)())

invoke a R function by name

Remarks

the named parameter list will be aligned with the function argument list and then do function invoke.

Parameters
NameTypeDescription
funcNameString

the R function name

argsNamedValue(Of Object)()

the named parameter list

method Evaluate overload 2 #
Evaluate(String)

Run R# script program from text data.

Parameters
NameTypeDescription
scriptString

The script text

method InitializeEnvironment #
InitializeEnvironment(String, NamedValue(Of Object)())
Parameters
NameTypeDescription
sourceString

The script file name

argumentsNamedValue(Of Object)()

-

method RunInternal #
RunInternal(Rscript, NamedValue(Of Object)(), Environment)
Parameters
NameTypeDescription
RscriptRscript

-

argumentsNamedValue(Of Object)()

symbol values that will be pushed into the runtime environment context

globalEnvirEnvironment

-

method Source #
Source(String, NamedValue(Of Object)(), Environment)

Run R# script program from a given script file. (运行脚本的时候调用的是RInterpreter.globalEnvir全局环境)

Parameters
NameTypeDescription
filepathString

The script file path.

argumentsNamedValue(Of Object)()

-

method FromEnvironmentConfiguration #
FromEnvironmentConfiguration(String)
Parameters
NameTypeDescription
configsString

the filepath of the configuration file

property globalEnvir #
globalEnvir

Global runtime environment.

Remarks

(全局环境)

property debug #
debug

R# running in debug mode.

Remarks

调试模式下,除了输出表达式的字符串信息之外 还会改变stop的行为,在非调试模式下,stop函数只会丢出错误消息并且终止脚本的运行 但是在调试模式下面,stop函数则会令程序抛出异常方便开发人员进行错误的定位

property redirectError2stdout #
redirectError2stdout

是否重定向错误消息输出至RInterpreter.RedirectOutput()函数所定义的输出设备之中

property strict #
strict

是否在严格模式下运行R#脚本?默认为严格模式,即:

  1. 所有的变量必须使用let关键词进行申明
property GetValue #
GetValue(String)

Get value of a Symbol

Parameters
NameTypeDescription
nameString

-

property globalSymbols #
globalSymbols

get all symbols inside the global environment

property Rsharp #
Rsharp

Default R# script interpreter which is created on the default environment.

field lastVariableName #
lastVariableName
property warnings #
warnings
property silent #
silent
property verbose #
verbose
property configFile #
configFile
property isExecCancel #
isExecCancel
method SetTaskCancelHook #
SetTaskCancelHook(CancellationTokenSource)
method RedirectOutput #
RedirectOutput(StreamWriter, OutputEnvironments)
method options #
options(String(), Nullable(Of Boolean), Nullable(Of Boolean))
method PrintMemory #
PrintMemory(TextWriter)
method Print #
Print(Object)
method Add #
Add(String, Delegate)
method Evaluate #
Evaluate(String, ValueTuple(Of String, Object)())
method Run #
Run(Program)
method Parse #
Parse(String)
method Dispose #
Dispose()
method op_Explicit #
op_Explicit(RInterpreter)