In shiny debug mode, unable to print variables to screen as of shiny 0.10 onwards?

1,833 views
Skip to first unread message

claymore...@gmail.com

unread,
Jun 20, 2014, 2:47:38 PM6/20/14
to shiny-...@googlegroups.com
I am wondering if there is an issue with the debugger in shiny from 0.10 onwards, at least on linux (ubuntu 12.04)?

When I try place the browser() in a shiny app, and run the program, I cannot print any variables to the screen.  I see the variables in the environment panel though.

When I revert back to shiny 0.9.1, printing of variables does in fact work.  Here's a screen shot to show the problem (left window).   Simple program.  First I can print variables with shiny 0.9.1 loaded.  Then I load shiny 0.10.0.9001, and the printing doesn't display anything in the console.  I had the same problem with shiny 0.10 which I loaded from CRAN too; decided to try the development version to see if the problem went away but it hasn't.

Any ideas on why printing variables in debug mode is not working?  (Is it local to me on linux, or a bug?)

Here is my session info:

sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shiny_0.10.0.9001

loaded via a namespace (and not attached):
 [1] bitops_1.0-6    Cairo_1.5-5     caTools_1.16    devtools_1.5    digest_0.6.4    evaluate_0.5.3  htmltools_0.2.4 httpuv_1.3.0    httr_0.3        memoise_0.1    
[11] parallel_3.1.0  Rcpp_0.11.1     RCurl_1.95-4.1  RJSONIO_1.0-3   stringr_0.6.2   tools_3.1.0     whisker_0.3-2   xtable_1.7-3
Screenshot from 2014-06-20 14:46:52.png

Alex Diament

unread,
Jun 23, 2014, 10:59:28 AM6/23/14
to shiny-...@googlegroups.com
I have been experiencing this same issue on Windows since 0.1 was released and have posted a message .. but have not yet received any feedback or reply.  The problem is more extensive than browser ... it also affects cat(), print() and str() ... they no longer work with the console. Someone from the development team should let us know what is going on (i.e., is this a bug in shiny or rstudio or is it a resolvable local issue?) and the timeline for a fix.  Any sort of further development in shiny is impractical ... if not impossible .. if this is not resolved.

Claymore

unread,
Jun 23, 2014, 3:56:01 PM6/23/14
to shiny-...@googlegroups.com
Thanks for the feedback. Agreed.

Joe Cheng [RStudio]

unread,
Jun 24, 2014, 9:04:29 AM6/24/14
to shiny-...@googlegroups.com
Whenever I've found myself in this situation with Shiny it's because the browser() call is inside of a call to renderPrint(), either directly or indirectly. The way renderPrint works is by wrapping your expression in capture.output(), which diverts all standard output to a buffer. It looks like what's new with Shiny 0.10 is that renderPlot now uses capture.output as well, a little too aggressively.

You can break out of the capture.output() from within the browser() by using sink(), as long as you don't mind the renderPrint() missing the rest of your output. Alternatively, you can do cat("message\n", file=stderr()) to bypass the capture.output() and go to the console for a single message.

We'll get the renderPlot part fixed for Shiny 0.10.1 which we're hoping to ship in the coming weeks. Thanks for the bug report!

Yihui Xie

unread,
Jun 25, 2014, 11:43:29 AM6/25/14
to claymore...@gmail.com, shiny-discuss
Sorry, my bad. Joe has fixed it in the development version
(0.10.0.9002) on Github. You may either test it or wait for the next
CRAN release. Thanks!

Regards,
Yihui

figm...@yahoo.com

unread,
Jun 26, 2014, 10:05:52 PM6/26/14
to Joe Cheng [RStudio], shiny-...@googlegroups.com
Joe,
Thanks for the update.  Will be awaiting the release of 0.10.1.  By the way, I've found that View() is an eminently suitable temporary alternative to display object values. Though it is not very flexible and will quickly clutter the desktop.)

Sent from my iPad
--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/an1rjXzv6CE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Clark

unread,
Jul 28, 2014, 8:08:23 PM7/28/14
to shiny-...@googlegroups.com, claymore...@gmail.com
how do I install dev version? 
Any eta on 0.10.1?

Joe Cheng

unread,
Jul 28, 2014, 10:32:36 PM7/28/14
to Andrew Clark, shiny-...@googlegroups.com, claymore...@gmail.com
It's on CRAN now. This bugfix wasn't mentioned in the NEWS file but it should be in there.


--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.

Andrew Clark

unread,
Jul 28, 2014, 10:54:25 PM7/28/14
to shiny-...@googlegroups.com, scott.r...@gmail.com, claymore...@gmail.com
OK Updated to 0.10.1 and worked fine
Tx
Reply all
Reply to author
Forward
0 new messages