Description Usage Arguments Details Value Author(s) See Also Examples
Library for using R objects (like ovariable
s.) stored in Opasnet R server. Also includes basic encryption and decryption functionality for R objects.
1 2 3 4 5 6 | objects.encode(obj, key)
objects.decode(eobj, key)
objects.get(token, print_names = TRUE)
objects.latest(page_ident, code_name, verbose = FALSE, ...)
objects.put(..., list = character())
objects.store(..., list = character(), verbose = FALSE)
|
obj |
Any R object. |
eobj |
An encoded object returned by |
key |
Key string to encode or decode objects. Must be 16,32 or 64 characters in length. |
token |
R-tools run token string to identify a stored object on Opasnet R server. |
print_names |
if |
page_ident |
Opasnet Media Wiki page identifier (e.g. op_en1390). |
code_name |
Name of the R code block in Opasnet Media Wiki (the |
verbose |
Flag to set more verbose output (for debug purposes). |
... |
Objects will be passed straight to R core |
list |
List will be passed straight to R core |
The main purpose of this library is to provide means to store R objects to Opasnet R server for later use. This is specifically useful
and embraced in Opasnet R ecosystem where this library is mainly used for storing and fetching ovariable
s. Storing objects
is currently only possible within Opasnet Media Wiki environments (using R code inside rcode
tags), but reading objects stored
by running code within public wikis is also possible from local R-installation.
Besides object storing, this library provides basic functionality to encode and decode R objects. This is done by using R base serialization functions
and digest
library. Objects given to objects.encode
will be encoded by using AES
function in "ECB" mode.
Longer key (16, 32 or 64 characters) obviously means more secured encryption too. Same key must be used for both encryption and decryption.
See also: http://en.opasnet.org/
objects.encode |
Returns encoded object to be decoded with |
objects.decode |
Returns decoded object, as it was before encoding with |
objects.get |
Returns object or objects stored to Opasnet R server. |
objects.latest |
Returns object or objects stored to Opasnet R server. |
objects.put |
No return value. |
objects.store |
Returns token to identify stored objects on R server. |
E. Happonen einari.happonen@thl.fi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Within Opasnet only! Let's assume that the (en.opasnet.org) page identifier -
# where to code is - would be "Op_en1390" and code name "objs_save_test".
x <- stats::runif(20)
y <- list(a = 1, b = TRUE, c = "Jeah baby jeah!")
## Not run:
objects.store(x, y)
## End(Not run)
# Fetching can be done also from local R installation.
## Not run:
objects.latest("Op_en1390","objs_save_test")
## End(Not run)
print(x)
print(y)
# Object encrypt and decrypt
key <- "1234567890abcdef"
eobj <- objects.encode(y, key)
print(eobj)
obj <- objects.decode(eobj, key)
print(obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.