Typed list
ts_list.RdA list is a vector of other robjects, which may or may not be named.
Details
There are five types of lists we can define:
Unknown list
Known, named list (e.g., list(x = 1:5, y = 'hello world')). This is an object in JS.
Known, unnamed list (e.g., list(1:5, 'hello world')). This is an array in JS.
Named list of a single datatype (e.g., list(fit1 = lm(...), fit2 = lm(...), ...)), where the names and length are not known ahead of time. This is a record<string, type> in JS.
Unnamed list of a single datatype (e.g., list(lm(...), lm(...), ...)), where the length is unknown ahead of time. This is an Array
in JS.
Examples
x <- ts_list(a = ts_integer(1), b = ts_character(1))
x$check(list(a = 1L, b = "a"))
#> $a
#> [1] 1
#>
#> $b
#> [1] "a"
#>