R implementation of TSON specification.
devtools::install_github("tercen/rtson", ref = "1.6.2", upgrade_dependencies = FALSE, args="--no-multiarch")
Type int64 partially implemented.
toTSON(tson.int64.vec(42))
toTSON(tson.uint64.vec(42))
library(rtson)
list = list(integer=42L,
double=42,
bool=TRUE,
uint8=tson.uint8.vec(c(42,0)),
uint16=tson.uint16.vec(c(42,0)),
uint32=tson.uint32.vec(c(42,0)),
int8=tson.int8.vec(c(42,0)),
int16=tson.int16.vec(c(42,0)),
int32=as.integer(c(42,0)),
float32=tson.float32.vec(c(0.0, 42.0)),
float64=c(42.0,42.0),
map=list(x=42, y=42, label="42"),
list=list("42",42)
)
bytes = toTSON(list)
print(as.integer(bytes))
object = fromTSON(bytes)
print(object)
rustinr::rustrize()
```R
object = list(a=rtson::tson.scalar(6), p=seq(1000))
rbenchmark::benchmark("jsonlite" = { jsonlite::fromJSON(jsonlite::toJSON(object)) }, "rtson-json" = { rtson::fromJSON(rtson::toJSON(object)) }, "rtson" = { rtson::fromTSON(rtson::toTSON(object)) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.