Tools to Work with the 'Splash' JavaScript Rendering Service in R
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
471 B

#' Convert a Base64 encoded string into an R object
#'
#' A simple wrapper around calls to `openssl::base64_decode()` and
#' `jsonlite::fromJSON()`.
#'
#' @md
#' @param x a string
#' @param flatten flatten JSON structures upon conversion?
#' @param ... passed on to `jsonlite::fromJSON()`
#' @export
json_fromb64 <- function(x, flatten=TRUE, ...) {
tmp <- openssl::base64_decode(x)
tmp <- readBin(tmp, "character")
jsonlite::fromJSON(tmp, flatten=flatten, ...)
}