I would like to let my users use a shiny app that is stored on gist.github.com using library(shiny);runGist("xxx")
.
For this purpose I've created a folder that contains portable Chrome, portable R and 2 files:
1 - run.R
- contains the following code:
library(shiny);runGist("xxx")
2 - VBScript that should call the run.r so the runGist will be invoked.
Randomize
CreateObject("Wscript.Shell").Run "R-Portable\App\R-Portable\bin\R.exe CMD BATCH --vanilla --slave run.R" & " " & RND & " ", 0, False
When I click the VBScript nothing happens so I guess I'm missing something, how can solve this issue?
UPDATE: after clicking the run.vbs I got a numbered file, when I opened it on Notepad++ I got the following text:
Downloading https://gist.github.com/#############/download
NULL
[1] TRUE
Listening on http://127.0.0.1:1337
When I copied http://127.0.0.1:1337
to the browser it gives what I want.
So the question is how to invoke the browser with address provided in the message? - I noticed that each click gives another address.
You can override default browser option, then runGist
with launch.browser
will just work.
run.R
#Assuming your portable Chrome's relative path is "Chrome\Application\chrome.exe"
options(browser = normalizePath("Chrome\\Application\\chrome.exe"));
library(shiny);
runGist("xxx", launch.browser = TRUE);
run.vbs
Set Fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("Wscript.Shell")
'specify CD to start commands from script's parent folder
WshShell.CurrentDirectory = Fso.GetParentFolderName(WScript.ScriptFullName)
'Start the command as hidden and don't wait
WshShell.Run "R-Portable\App\R-Portable\bin\R.exe CMD BATCH --vanilla --slave run.R NUL", 0, False
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With