Module: RObject
Common module for working with R objects.
Table of contents
Type Aliases
Variables
Functions
Type Aliases
Complex
Ƭ Complex: Object
Type declaration
Name | Type |
---|---|
im |
number |
re |
number |
Defined in
webR/robj.ts:45
NamedEntries
Ƭ NamedEntries<T
>: [string
| null
, T
][]
Type parameters
Name |
---|
T |
Defined in
webR/robj.ts:67
NamedObject
Ƭ NamedObject<T
>: Object
Type parameters
Name |
---|
T |
Index signature
▪ [key: string
]: T
Defined in
webR/robj.ts:68
RPtr
Ƭ RPtr: number
Defined in
webR/robj.ts:8
RType
Ƭ RType: keyof typeof RTypeMap
Defined in
webR/robj.ts:39
RTypeNumber
Ƭ RTypeNumber: typeof RTypeMap
[RType
]
Defined in
webR/robj.ts:40
WebRData
Ƭ WebRData: RObject
| RObjectBase
| RObject
| WebRDataRaw
| WebRDataJs
| WebRData
[] | ArrayBuffer
| ArrayBufferView
| { [key: string]
: WebRData
; }
A union of JavaScript types that are able to be converted into an R object.
WebRData
is used both as a general input argument for R object construction and also as a general return type when converting R objects into JavaScript.
Defined in
webR/robj.ts:77
WebRDataAtomic
Ƭ WebRDataAtomic<T
>: WebRDataScalar
<T
> | WebRDataJsAtomic
<T
> | NamedObject
<T
| null
> | [T
] extends [number
] ? ArrayBuffer
| ArrayBufferView
| (number
| null
)[] : (T
| null
)[]
A subset of WebRData for JavaScript objects that can be converted into R atomic vectors.
Type parameters
Name | Description |
---|---|
T |
The JavaScript scalar type associated with the atomic vector. |
Defined in
webR/robj.ts:93
WebRDataJs
Ƭ WebRDataJs: WebRDataJsNull
| WebRDataJsString
| WebRDataJsSymbol
| WebRDataJsNode
| WebRDataJsAtomic
<atomicType
>
WebRDataJs
objects form a tree structure, used when serialising R objects into a JavaScript representation.
Nested R objects are serialised using the WebRDataJsNode type, forming branches in the resulting tree structure, with leaves formed by the remaining types.
Defined in
webR/robj.ts:107
WebRDataJsAtomic
Ƭ WebRDataJsAtomic<T
>: Object
Type parameters
Name |
---|
T |
Type declaration
Name | Type |
---|---|
names |
(string | null )[] | null |
type |
"logical" | "integer" | "double" | "complex" | "character" | "raw" |
values |
(T | null )[] |
Defined in
webR/robj.ts:136
WebRDataJsNode
Ƭ WebRDataJsNode: Object
Type declaration
Name | Type |
---|---|
names |
(string | null )[] | null |
type |
"list" | "pairlist" | "environment" |
values |
(WebRDataRaw | RObject | RObject | WebRDataJs )[] |
Defined in
webR/robj.ts:130
WebRDataJsNull
Ƭ WebRDataJsNull: Object
Type declaration
Name | Type |
---|---|
type |
"null" |
Defined in
webR/robj.ts:114
WebRDataJsString
Ƭ WebRDataJsString: Object
Type declaration
Name | Type |
---|---|
type |
"string" |
value |
string |
Defined in
webR/robj.ts:118
WebRDataJsSymbol
Ƭ WebRDataJsSymbol: Object
Type declaration
Name | Type |
---|---|
internal |
RPtr | null |
printname |
string | null |
symvalue |
RPtr | null |
type |
"symbol" |
Defined in
webR/robj.ts:123
WebRDataRaw
Ƭ WebRDataRaw: number
| string
| boolean
| undefined
| null
| void
| Complex
| Error
| ArrayBuffer
| ArrayBufferView
| ImageBitmap
| WebRDataRaw
[] | Map
<WebRDataRaw
, WebRDataRaw
> | Set
<WebRDataRaw
> | { [key: string]
: WebRDataRaw
; }
Defined in
webR/robj.ts:50
WebRDataScalar
Ƭ WebRDataScalar<T
>: T
| RObject
| RObjectBase
A subset of WebRData for scalar JavaScript objects.
Type parameters
Name |
---|
T |
Defined in
webR/robj.ts:155
Variables
RTypeMap
• Const
RTypeMap: Object
Type declaration
Name | Type |
---|---|
any |
18 |
builtin |
8 |
bytecode |
21 |
call |
6 |
character |
16 |
closure |
3 |
complex |
15 |
dots |
17 |
double |
14 |
environment |
4 |
expression |
20 |
free |
31 |
function |
99 |
integer |
13 |
list |
19 |
logical |
10 |
new |
30 |
null |
0 |
pairlist |
2 |
pointer |
22 |
promise |
5 |
raw |
24 |
s4 |
25 |
special |
7 |
string |
9 |
symbol |
1 |
weakref |
23 |
Defined in
webR/robj.ts:10
Functions
isComplex
▸ isComplex(value
): value is Complex
Test if an object is of type Complex.
Parameters
Name | Type | Description |
---|---|---|
value |
any |
The object to test. |
Returns
value is Complex
True if the object is of type Complex.
Defined in
webR/robj.ts:162
isWebRDataJs
▸ isWebRDataJs(value
): value is WebRDataJs
Test for a WebRDataJs instance.
Parameters
Name | Type | Description |
---|---|---|
value |
any |
The object to test. |
Returns
value is WebRDataJs
True if the object is an instance of a WebRDataJs.
Defined in
webR/robj.ts:147