Create a deferred list
deflist.Rd
A read-only list that retrieves elements with a function call. The deferred list is useful for handling large datasets where elements are computed on-demand.
Usage
deflist(
fun,
len = 1,
names,
memoise = FALSE,
cache = c("memory", "file"),
cachedir = NULL
)
Arguments
- fun
A function that is used to retrieve elements.
- len
Integer, the length of the list (default is 1).
- names
Character vector, an optional set of names, one per element.
- memoise
Logical, whether to memoise the function to speed up repeated element access (default is FALSE).
- cache
Character, use an in-memory or filesystem cache if
memoise
is TRUE (default is "memory").- cachedir
Character, the file path to the cache (default is NULL).