Connecting

From R

The RStudio IDE provides a push-button publishing experience for some content types. See the Connecting - RStudio IDE chapter for details.

If you need to publish a type of content that doesn’t support push-button publishing or if you want to publish from R code or the R console, follow these instructions to get started.

You will need the following information to connect your account:

  • The Posit Connect server URL
  • Your username on the Connect server
  • An API Key from the Connect server. See the API Keys chapter.

First, install the rsconnect R package:

install.packages("rsconnect")

Then use the rsconnect::addServer()1 and rsconnect::connectApiUser() functions to configure the server location and your account:

rsconnect::addServer(
    "https://connect.mydomain.com",
    name = "connect.mydomain.com")
rsconnect::connectApiUser(
    server="connect.mydomain.com",
    account="myusername",
    apiKey="micOXRF89vCQgEr1DovGQMyhmsASz1sf")

Now you’re ready to publish! See the Publishing from R chapter.

Footnotes

  1. Use rsconnect::addConnectServer rather than rsconnect::addServer when using rsconnect versions before 1.0.0.↩︎