diff --git a/R/display.R b/R/display.R index d8e42e2..9cf2571 100644 --- a/R/display.R +++ b/R/display.R @@ -2,8 +2,8 @@ #' @importFrom stats setNames namedlist <- function() setNames(list(), character(0)) -base_display <- function(data, metadata) { - warning("IR_display can only be used from the IPython R kernel and R magic.") +base_display <- function(data, metadata = NULL) { + getOption('jupyter.base_display_func')(data, metadata) } #' Display data by mimetype, with optional alternative representations. diff --git a/R/options.r b/R/options.r index f1c89d9..e50c142 100644 --- a/R/options.r +++ b/R/options.r @@ -12,7 +12,11 @@ opt.defaults <- list( 'application/pdf', 'image/png', 'image/jpeg', - 'image/svg+xml') + 'image/svg+xml'), + jupyter.base_display_func = function(data, metadata = NULL){ + warning('IRdisplay can only be used from the IPython R kernel and R magic.') + } + ) .onLoad <- function(libname = NULL, pkgname = NULL) {