R/copiedFromJaspBase.R

Defines functions .extractErrorMessage toJSON fromJSON

# TODO: copied from common, do this more elegantly!
fromJSON  <- function(x) jsonlite::fromJSON(x, TRUE, FALSE, FALSE)
toJSON    <- function(x) jsonlite::toJSON(x, auto_unbox = TRUE, digits = NA, null = "null")
.extractErrorMessage <- function(error) {

  split <- base::strsplit(as.character(error), ":")[[1]]
  last <- split[[length(split)]]
  trimws(last)
}
vandenman/JASPgraphs documentation built on Dec. 16, 2021, 5:37 p.m.