1

I am implementing an R shiny application. I am using cat and print to write to the console and be able to see what is going on.

In the server.R I have some calls to cat before the shinyServer function and they work well. I have though other calls to cat inside shinyServer and their content is not printed although the code is executed, I see the output in the web UI, they are in a reactive block. The UI.R uses a submitButton in case this makes a difference.

As far as I have read, cat should send to console unless redirected, what I am not doing. I am also using cat with file="" and file=stdout() to try avoid any redirection.

If I run the app from a shortcut on the console that gets open the situation is the same. Any ideas on what can be happening?

I use R 3.1.1 and R studio 0.98 in Windows 7.

Picarus
  • 760
  • 1
  • 10
  • 25
  • possible duplicate of [Shiny: What is the option setting to display in the console the messages between server and ui](http://stackoverflow.com/questions/23002712/shiny-what-is-the-option-setting-to-display-in-the-console-the-messages-between) – topchef Nov 04 '14 at 04:20
  • @topchef no, I don't refer to this setting that shows the communication between client and server. I refer to include my own messages on the console – Picarus Nov 04 '14 at 07:04
  • since I made the question I have found that I can see the messages if I use file=stderr() but I still don't understand why there is a default redirection and how to revert it – Picarus Nov 04 '14 at 07:05
  • 1
    Its very difficult to speculate on the answer without an example. I can suggest you check that the 'print' isnt at the end of any reactive expression. You can further look here where you can maybe use message("my personal msg") http://stackoverflow.com/questions/11533284/difference-between-paste-and-print-effecting-result-of-function or there http://stackoverflow.com/questions/12775085/the-difference-between-concatenating-character-strings-with-paste-vs-cat – Pork Chop Nov 04 '14 at 08:09
  • @pops, message gets the job done but I would like to know while cat doesn't work even when I set file=stdout() and when it works for stderr(). I give you +1 – Picarus Nov 04 '14 at 09:54
  • 1
    I had similar problem: it disappeared after upgrading shiny package (I saw discussion thread about it but can't locate it anymore). – topchef Nov 04 '14 at 15:19
  • 1
    found it: http://goo.gl/iYFGQ7 – topchef Nov 04 '14 at 15:20
  • @topchef, thanks I will update my shiny version after I finish this project... I already upgraded in a new machine I had to setup and found bugs on other parts so I had to revert to the versions on my dev machine... with the message and cat stderr thing I will survive so far. – Picarus Nov 04 '14 at 21:36

1 Answers1

0

Upgrading shiny (currently 0.10.2.1) resolved this problem for me. Also, see related discussion here.

topchef
  • 19,091
  • 9
  • 63
  • 102