Is there a way to use .Rprofile in shiny apps?

749 views
Skip to first unread message

Dean Attali

unread,
Jun 27, 2015, 5:54:25 PM6/27/15
to shinyap...@googlegroups.com
Hi all,

I like to set special `options()` in my .Rprofile, such as API tokens, so that in my code when I want to eg. connect to a database, I can just use the options instead of hardcoding values. I was wondering if there's a way to set an .Rprofile for apps in shinyapps.io?

Yihui Xie

unread,
Jun 27, 2015, 6:10:29 PM6/27/15
to Dean Attali, shinyap...@googlegroups.com
Have you tried it? At least .Renviron in the app root directory worked
for me a few months ago on ShinyApps.io, but I'm not sure if it still
works, or if .Rprofile is also supported.

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Web: http://yihui.name

Dean Attali

unread,
Jun 27, 2015, 6:15:14 PM6/27/15
to Yihui Xie, shinyap...@googlegroups.com
Thanks Yihui, I should clarify that I meant it more as "is there a way to have a global .Rprofile, not app-specific"

Tareef Kawaf

unread,
Jun 29, 2015, 11:46:41 AM6/29/15
to Dean Attali, Yihui Xie, shinyap...@googlegroups.com
Not really, no, shinyapps.io presumes that every application is isolated from every other application. 
It might be interesting to consider some files that we will "globally place" in each application for you, but it honestly hasn't come up before now.

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/CA%2Bj8Z%2BmVmxFOnUhO5GDoO9oh3qG7cbcdt57TtABwhi_SJOMn-A%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Dean Attali

unread,
Jun 29, 2015, 11:55:30 AM6/29/15
to Tareef Kawaf, Yihui Xie, shinyap...@googlegroups.com
That's fair, I'm not necessarily requesting this feature, just wanted to know if it's possible because there are some global options I use in multiple shiny apps on my shiny server and just wanted to see if I can have a global rprofile on shinyapps as well or not. It's not a big deal to have to replicate it per application, that's maybe the more correct way since shinyapps is intended more to host specific apps than a bundle of them together.

Tareef Kawaf

unread,
Jun 29, 2015, 12:01:59 PM6/29/15
to Dean Attali, Yihui Xie, shinyap...@googlegroups.com
Yes, exactly.  Things are much easier to scale if they are isolated from each other.  
Reply all
Reply to author
Forward
0 new messages