miroir de https://git.sr.ht/~hrbrmstr/splashr
Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
17 lignes
471 B
17 lignes
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, ...)
|
|
|
|
}
|
|
|