R/summary.R

Defines functions jsonSummary

Documented in jsonSummary

#' @title JSON summary
#'
#' @description
#' produces a json summary of includes dataset specified by parameter [d].
#' @param d
#' A \code{string} representing the dataset name which json representation should be returned.
#' @return
#' returns a json representation of an included dataset
#' @author
#' Robert Studtrucker
#' @export
#' @examples

jsonSummary <- function(d) {
  requireNamespace("jsonlite")

  dat <- d

  val <-jsonlite::toJSON(lapply(dat, function(x){as.list(summary(x))}), pretty = TRUE, auto_unbox = TRUE)
  return(val)

}
leibniz-psychology/PsychOpen-CAMA-R-package documentation built on April 17, 2025, 5:27 p.m.