Repository navigation
Closed
Labels
Description
It's basically the same issue than with knitr. I have printed the variable SYS (at line 82 of data.table.R) after a command such as DT[, a:=1] in IRKernel but I don't know enough to do a pull request.
[[1]]
IRkernel::main()
[[2]]
kernel$run()
[[3]]
handle_shell()
[[4]]
executor$execute(msg)
[[5]]
with_top_env(userenv, {
tryCatch(evaluate(request$content$code, envir = userenv,
output_handler = oh, stop_on_error = 0), interrupt = function(cond) {
interrupted <<- TRUE
}, error = handle_error)
})
[[6]]
tryCatch(evaluate(request$content$code, envir = userenv, output_handler = oh,
stop_on_error = 0), interrupt = function(cond) {
interrupted <<- TRUE
}, error = handle_error)
[[7]]
tryCatchList(expr, classes, parentenv, handlers)
[[8]]
tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
names[nh], parentenv, handlers[[nh]])
[[9]]
doTryCatch(return(expr), name, parentenv, handler)
[[10]]
tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
[[11]]
tryCatchOne(expr, names, parentenv, handlers[[1L]])
[[12]]
doTryCatch(return(expr), name, parentenv, handler)
[[13]]
evaluate(request$content$code, envir = userenv, output_handler = oh,
stop_on_error = 0)
[[14]]
evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos,
debug = debug, last = i == length(out), use_try = stop_on_error !=
2L, keep_warning = keep_warning, keep_message = keep_message,
output_handler = output_handler)
[[15]]
handle(pv <- withCallingHandlers(withVisible(value_fun(ev$value,
ev$visible)), warning = wHandler, error = eHandler, message = mHandler))
[[16]]
try(f, silent = TRUE)
[[17]]
tryCatch(expr, error = function(e) {
call <- conditionCall(e)
if (!is.null(call)) {
if (identical(call[[1L]], quote(doTryCatch)))
call <- sys.call(-4L)
dcall <- deparse(call)[1L]
prefix <- paste("Error in", dcall, ": ")
LONG <- 75L
msg <- conditionMessage(e)
sm <- strsplit(msg, "\n")[[1L]]
w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
if (is.na(w))
w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
type = "b")
if (w > LONG)
prefix <- paste0(prefix, "\n ")
}
else prefix <- "Error : "
msg <- paste0(prefix, conditionMessage(e), "\n")
.Internal(seterrmessage(msg[1L]))
if (!silent && identical(getOption("show.error.messages"),
TRUE)) {
cat(msg, file = stderr())
.Internal(printDeferredWarnings())
}
invisible(structure(msg, class = "try-error", condition = e))
})
[[18]]
tryCatchList(expr, classes, parentenv, handlers)
[[19]]
tryCatchOne(expr, names, parentenv, handlers[[1L]])
[[20]]
doTryCatch(return(expr), name, parentenv, handler)
[[21]]
withCallingHandlers(withVisible(value_fun(ev$value, ev$visible)),
warning = wHandler, error = eHandler, message = mHandler)
[[22]]
withVisible(value_fun(ev$value, ev$visible))
[[23]]
value_fun(ev$value, ev$visible)
[[24]]
value_handler(x)
[[25]]
paste(capture.output(print(obj)), collapse = "\n")
[[26]]
capture.output(print(obj))
[[27]]
evalVis(expr)
[[28]]
withVisible(eval(expr, pf))
[[29]]
eval(expr, pf)
[[30]]
eval(expr, envir, enclos)
[[31]]
print(obj)
[[32]]
print.data.table(obj)
Activity
mattdowle commentedon Apr 28, 2016
Can this be closed now as it was from 2014 before the changes in v1.9.6 released in Sep 2015.
Although, something related has been raised recently as well :
https://github.com/IRkernel/IRkernel/issues/127#issuecomment-203070341
jankatins commentedon May 19, 2016
irkernel prints via the repr package, i.e.
repr_text.default()(source) orrepr_text.matrix(source) If the latter, it is also printed byrepr_html.matrix,repr_markdown.matrixandrepr_latex.matrix. IMO the same workaround as forknit_print.defaultshould go in here:data.table/R/data.table.R
Line 35 in d356700
Or make that a similar list as
data.table/R/cedta.R
Line 4 in 9d2d710
Or build and export
repr_xxx.data.framemethods which only spit out a string representation if print would print the data.table (is that possible?)cc: @flying-sheep
mattdowle commentedon May 19, 2016
@JanSchulz Ok good idea. Thanks for investigating. Happy to try the simpler one first and see if it works ("making it a similar list as"). Will do.
Added mimicsAutoPrint for IRKernel, #933
Added shouldPrint for use by IRkernel, #933
mattdowle commentedon May 19, 2016
Current status : https://github.com/IRkernel/IRkernel/issues/127#issuecomment-220479914
mattdowle commentedon May 26, 2016
New status: https://github.com/IRkernel/IRkernel/issues/127#issuecomment-221957831
MichaelChirico commentedon Jun 7, 2020
Just tried this on JupyterLab, it seems OK?
Closing ...