The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Storage
object### 1. Create a `Storage` object:
my_storage <- Storage$new()
# 2. Add elements along with identifiers:
my_storage$
add(42, c("number", "rational"))$
add(pi, c("number", "!rational"))$
add("fear of black cats", c("text", "!rational"))$
add("wearing a seat belt", c("text", "rational"))$
add(mean, "function")
# 3. What elements are stored?
print(my_storage)
#> number of elements: 5
#> identifiers used: number rational text function
# 4. Extract elements based on identifiers:
my_storage$get("rational")
#> [[1]]
#> [1] 42
#>
#> [[2]]
#> [1] "wearing a seat belt"
my_storage$get("!rational")
#> [[1]]
#> [1] 3.141593
#>
#> [[2]]
#> [1] "fear of black cats"
my_storage$get(c("text", "!rational"))
#> [[1]]
#> [1] "fear of black cats"
my_storage$get("all") # get all elements
#> [[1]]
#> [1] 42
#>
#> [[2]]
#> [1] 3.141593
#>
#> [[3]]
#> [1] "fear of black cats"
#>
#> [[4]]
#> [1] "wearing a seat belt"
#>
#> [[5]]
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x572097c4c7b0>
#> <environment: namespace:base>
my_storage$get(c("text", "!text"))
#> list()
my_storage$get(c("text", "!text"), logical = "or")
#> [[1]]
#> [1] 42
#>
#> [[2]]
#> [1] 3.141593
#>
#> [[3]]
#> [1] "fear of black cats"
#>
#> [[4]]
#> [1] "wearing a seat belt"
#>
#> [[5]]
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x572097c4c7b0>
#> <environment: namespace:base>
# 5. Extract elements based on ids:
my_storage$get(ids = 4:5)
#> [[1]]
#> [1] "wearing a seat belt"
#>
#> [[2]]
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x572097c4c7b0>
#> <environment: namespace:base>
my_storage$get(ids = 4:5, id_names = TRUE) # add the ids as names
#> $`4`
#> [1] "wearing a seat belt"
#>
#> $`5`
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x572097c4c7b0>
#> <environment: namespace:base>
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.