forked from daattali/advanced-shiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add note that runcode is now in shinyjs
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# Run arbitrary code live in Shiny - great for testing during development | ||
|
||
**NOTE: This is now part of the `shinyjs` package. All you need to achieve the results below is to run two functions in your shiny app - look at the documentation for `?shinyjs::runcode`.** | ||
|
||
When I develop Shiny apps or packages for Shiny, I often find myself wanting to be able to run R code on-demand while the app is running. Outside of Shiny, in regular R programming, we have the R console where we can run any command at any point in time, but in Shiny we don't really have that. So while developing, I often add a text input that lets me type any R code into it and then run it. This is very useful for testing. | ||
|
||
**WARNING:** Do not provide this in a Shiny app that anyone else can access. This should be **strictly used for testing locally**. Having other people run arbitrary code in your app is asking for trouble. | ||
|
||
--- | ||
|
||
[](./run-arbitrary-code.gif) | ||
[](./run-arbitrary-code.gif) |