1

I'm working on some code in R that makes heavy use of the package rpostgresql. Some of the queries I'm using take quite a while to download, so I would like to periodically show a message to the users (something like "Download in progress, please be patient..") so that it is clear that the program didn't crash.

Ideally, I'd like to write the code as an all-purpose wrapper for functions so that it will give feedback to the user along the way (download in progress, time elapsed, etc.)

For example, if we have an example function:

x<-runif(10)

I would like to make a wrapper of the form

some_wrapper_function(x<-runif(10))

where some_wrapper_function gives periodic updates while the wrapped code is running.

It seems like this requires parallel coding, but with the hitch that the clusters need to talk to each other at least once.

Any thoughts? Or is there an existing function that does this?

Brian M
  • 11
  • 1
  • Take a look at: http://stackoverflow.com/questions/26919787/r-text-progress-bar-in-for-loop and https://stat.ethz.ch/R-manual/R-devel/library/utils/html/txtProgressBar.html – Adam Warner Aug 01 '16 at 18:39
  • I've looked at a few of the status bar approaches and they don't seem to work for this instance since they require some sort of a counter. Since I want a wrapper that can accommodate SQL queries which will take a variable amount of time (depending on internet connectivity, file size, etc.) there isn't a way that I can see to make the typical "counter" approach work in this instance – Brian M Aug 01 '16 at 18:44

0 Answers0