print function not outputting?

116 views
Skip to first unread message

Charles Driver

unread,
Dec 10, 2015, 9:14:04 AM12/10/15
to Stan users mailing list
I believe this was working for me before I updated rstan recently - now when I use print(), I either get all the output (up to the limit of the console) when the sampling is finished, or if an error occurs, I seem to get the previous two print statements. Is there a setting I can change so I see print output on the fly? This is in rstudio on windows, in case it's relevant...

Ben Goodrich

unread,
Dec 10, 2015, 9:46:51 AM12/10/15
to Stan users mailing list
On Thursday, December 10, 2015 at 9:14:04 AM UTC-5, Charles Driver wrote:
I believe this was working for me before I updated rstan recently - now when I use print(), I either get all the output (up to the limit of the console) when the sampling is finished, or if an error occurs, I seem to get the previous two print statements. Is there a setting I can change so I see print output on the fly? This is in rstudio on windows, in case it's relevant...

When there is a runtime error, it only shows the last 10 lines of a file in tempdir() that has a random name with StanProgress.txt appended to it. So, you can open that file in RStudio if you need to see more. If there is no error, then print statements should appear in the Viewer at the same time as the percentage completed. But we redid some writer stuff in the last release, so maybe it is doing something weird on Windows.

Ben
 

Charles Driver

unread,
Dec 10, 2015, 9:50:53 AM12/10/15
to Stan users mailing list
Ok - what do you mean by 'viewer'? I just get a message in the console every so often about the number of iterations completed, or when using multiple cores, no output at all, until finish. Is this maybe an issue interacting with rstudio?

Ben Goodrich

unread,
Dec 10, 2015, 9:59:36 AM12/10/15
to Stan users mailing list
On Thursday, December 10, 2015 at 9:50:53 AM UTC-5, Charles Driver wrote:
Ok - what do you mean by 'viewer'? I just get a message in the console every so often about the number of iterations completed, or when using multiple cores, no output at all, until finish. Is this maybe an issue interacting with rstudio?

I think you have either an outdated RStudio or an outdated rstan. These days all the progress and stuff should appear in a tab in the top right corner (if you have a default configuration of RStudio).

Ben

Charles Driver

unread,
Dec 10, 2015, 7:28:08 PM12/10/15
to Stan users mailing list
Thanks, this is great. I'd never noticed the viewer tab so didn't realise what I was missing...

Charles Driver

unread,
Dec 11, 2015, 7:06:08 AM12/11/15
to Stan users mailing list
I maybe spoke too soon. It is great, but now it's the viewer that is only displaying print output once all chains are finished. Is this by design?

Ben Goodrich

unread,
Dec 11, 2015, 7:26:32 AM12/11/15
to Stan users mailing list
On Friday, December 11, 2015 at 7:06:08 AM UTC-5, Charles Driver wrote:
I maybe spoke too soon. It is great, but now it's the viewer that is only displaying print output once all chains are finished. Is this by design?

No, it should be incremental. What version of RStudio do you have?

Charles Driver

unread,
Dec 12, 2015, 6:21:34 PM12/12/15
to Stan users mailing list
latest release, 99.489. Just checked and the same script outputs as expected when using vanilla R, so yes it's related to rstudio...
Reply all
Reply to author
Forward
0 new messages