Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify which shiny account to use when deploying?

I just want to ask about shiny accounts, I have two shiny registered accounts and now when I want to deploy I saw error like this

Do you want to proceed with deployment? [Y/n]: y
Error: Please specify the account which you want to deploy the application to (there is more than one account registered on this system).

So my question is how to specify the account that I want to used it in deploy application, when I just tried to run like this

    shinyapps::setAccountInfo(name='xxxx', 
                              token='13SDADASDSADAD9FCCEC48C016D5D97',
                              secret='863pLqbfaxeradasdafasfsadxzadadXgi2NfXh')
setwd('D:/ASD/test')
library(shinyapps)
deployApp()

I still got same error.

like image 824
user46543 Avatar asked Oct 06 '14 18:10

user46543


People also ask

Which deployment method should you select for your Shiny app if you do not want to run your own server?

Shinyapps.io Want to deploy to the web but prefer not to run your own server? You can host your Shiny apps on the web in minutes with Shinyapps.io.

How do I get a Shiny account?

Create a shinyapps.io accountGo to shinyapps.io and click “Dashboard.” The site will ask you to sign in using your email and password, your Google account, or your GitHub account. The first time you sign in, shinyapps.io prompts you to set up your account.


2 Answers

Go to top menu your Rstudio-> Tools-> ShinnyApps -> Manage Accounts

like image 131
rischan Avatar answered Oct 07 '22 05:10

rischan


There are mainly two different parameters to set up: the name and the account, each used in a different function. Previous answers did not make this altogether clear, so let me add explanations.

Step 1: Set name via setAccountInfo():

Go to https://www.shinyapps.io/admin/#/dashboard and get your personal name/token/secret, e.g. "myName" / "myToken" / "mySecret". You'll need all three to authorize your account.

library(shiny)
library(rsconnect)
rsconnect::setAccountInfo(
    name = "myName", 
    token = "myToken",
    secret = "mySecret")

You're now ready to deploy your apps. If you have a single account, that is all you need to do. But with multiple accounts, you also need to set the account explicitly in the deployApp() function:

Step 2: Set account via deployApp():

setwd("my/local/dir/") # or set the full path below
rsconnect::deployApp("myAppNameOffline", 
    appName = "myAppNameOnline", 
    account = "myname") 

Bonus: If you set option appName explicitly your app can have a different name online as it does offline, e.g. "myapp-version-999" can simply become "myapp" online.

like image 4
PatrickT Avatar answered Oct 07 '22 05:10

PatrickT