R/zzz.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) {

  op <- options()
  op.shinyjqui <- list(shinyjqui.debug = FALSE)
  toset <- !(names(op.shinyjqui) %in% names(op))
  if(any(toset)) options(op.shinyjqui[toset])

  shiny::registerInputHandler("shinyjqui.df", function(data, shinysession, name) {
    data <- lapply(data, function(x) {
      `if`(length(x) == 0, NA_character_, unlist(x))
    })
    data.frame(data, stringsAsFactors = FALSE)
  }, force = TRUE)

  invisible()

}

Try the shinyjqui package in your browser

Any scripts or data that you put into this service are public.

shinyjqui documentation built on Feb. 23, 2021, 9:06 a.m.