Have you ever wanted to follow a log file in real-time within a Shiny app? If you are familiar with linux, you might be looking for tail -f my.log.
The shinytail package should fill this desire. It provides helpers to easily:
- use
processxto executetail -f my.logon the server (tailFile) - stream the results into Shiny using
readStream - display the results in a "stream-friendly" UI widget called
shinyTail
We also provide a helper for writing such streams to a file during testing (writeStream).
Install the latest development version:
devtools::install_github("colearendt/shinytail")
There is a simple example app in this repository.
Another use case is to use RStudio Server
Pro with R console
auditing
along with shinytail for a real-time, live-coding Shiny app! This approach can
be useful for training and workshops.
- If you are trying to use R console auditing, be sure to restart the RStudio
Server Pro service and the R session after the configuration option
audit-r-console=inputis set. Otherwise, no auditing will happen. - Something strange happens when writing a stream in a background process of a
Shiny application. We are not sure yet if this is a
callrandshinycompatibility issue or where the problem is occurring.