Class: Shelter

WebR.Shelter

WebR shelters provide fine-grained control over the lifetime of R objects.

Table of contents

Properties

Methods

Properties

RCall

RCall: ProxyConstructor<typeof RCall, RCall>

Defined in

webR/webr-main.ts:412


RCharacter

RCharacter: ProxyConstructor<typeof RCharacter, RCharacter>

Defined in

webR/webr-main.ts:404


RComplex

RComplex: ProxyConstructor<typeof RComplex, RComplex>

Defined in

webR/webr-main.ts:405


RDouble

RDouble: ProxyConstructor<typeof RDouble, RDouble>

Defined in

webR/webr-main.ts:403


REnvironment

REnvironment: ProxyConstructor<typeof REnvironment, REnvironment>

Defined in

webR/webr-main.ts:409


RInteger

RInteger: ProxyConstructor<typeof RInteger, RInteger>

Defined in

webR/webr-main.ts:402


RList

RList: ProxyConstructor<typeof RList, RList>

Defined in

webR/webr-main.ts:407


RLogical

RLogical: ProxyConstructor<typeof RLogical, RLogical>

Defined in

webR/webr-main.ts:401


RObject

RObject: ProxyConstructor<typeof RObject, RObject>

Defined in

webR/webr-main.ts:400


RPairlist

RPairlist: ProxyConstructor<typeof RPairlist, RPairlist>

Defined in

webR/webr-main.ts:408


RRaw

RRaw: ProxyConstructor<typeof RRaw, RRaw>

Defined in

webR/webr-main.ts:406


RString

RString: ProxyConstructor<typeof RString, RString>

Defined in

webR/webr-main.ts:411


RSymbol

RSymbol: ProxyConstructor<typeof RSymbol, RSymbol>

Defined in

webR/webr-main.ts:410

Methods

captureR

captureR(code, options?): Promise<{ output: unknown[] ; result: RObject }>

Evaluate the given R code, capturing output.

Stream outputs and conditions raised during exectution are captured and returned as part of the output of this function. Returned R objects are protected by the shelter.

Parameters

Name Type Description
code string The R code to evaluate.
options? EvalROptions Options for the execution environment.

Returns

Promise<{ output: unknown[] ; result: RObject }>

An object containing the result of the computation and and array of captured output.

Defined in

webR/webr-main.ts:509


destroy

destroy(x): Promise<void>

Parameters

Name Type
x RObject

Returns

Promise<void>

Defined in

webR/webr-main.ts:454


evalR

evalR(code, options?): Promise<RObject>

Evaluate the given R code.

Stream outputs and any conditions raised during exectution are written to the JavaScript console. The returned R object is protected by the shelter.

Parameters

Name Type Description
code string The R code to evaluate.
options? EvalROptions Options for the execution environment.

Returns

Promise<RObject>

The result of the computation.

Defined in

webR/webr-main.ts:481


purge

purge(): Promise<void>

Returns

Promise<void>

Defined in

webR/webr-main.ts:446


size

size(): Promise<number>

Returns

Promise<number>

Defined in

webR/webr-main.ts:462