To use a RStudio Connect board, you need to first authenticate. The easiest way to do so is by launching Tools - Global Options - Publishing

  • Connect, and follow the instructions.

If you use multiple RStudio connect servers or multiple user accounts, you'll need to specify the server or account parameters when connecting to the board.

board_register_rsconnect(
  name = "rsconnect",
  server = NULL,
  account = NULL,
  key = NULL,
  output_files = FALSE,
  cache = board_cache_path(),
  ...
)

board_rsconnect(
  name = "rsconnect",
  server = NULL,
  account = NULL,
  key = NULL,
  output_files = FALSE,
  cache = board_cache_path(),
  ...
)

Arguments

name

Optional name for this board, defaults to 'rsconnect'.

server

Optional address to RStudio Connect server.

account

Optional account name to use with RStudio Connect.

key

The RStudio Connect API key.

output_files

Should the output in an automated report create output files?

cache

The local folder to use as a cache, defaults to board_cache_path().

...

Additional parameters required to initialize a particular board.

Sharing

You can share pins with others in RStudio Connect by changing the viewers of the document to specific users or groups. This is accomplished by opening the new published pin and then changing access under the settings tab. After you've shared the pin, it will be automatically available to others.

Public

You can also choose to share a pin publicly and avoid having to register the RStudio Connect board to retrieve this pin.

To create a public pin, first publish a pin and navigate to RStudio Connect; then set the "Access" to "Anyone - no login required" -- The pin will become public and accessible to anyone using their content URL. The remote resource stored in RStudio Connect can then be cached locally with pin() as follows:

pin("https://rstudio-connect-server/content/1234", name = "my-rsc-content")

To avoid having to change the "Access" manually, you can also set the access_type to acl, loggend_in or all when creating a pin:

 pin("https://rstudio-connect-server/content/1234", name = "my-rsc-content",
   access_type = "all"
 )

Automation

One significant advantage of RStudio Connect over other boards is its ability to schedule R Markdown reports to automate the creation of pins.

To support automation you need to use an RStudio Connect API Key as your authentication method. Once you've got an API key, you can connect to the board with:

board_register_rsconnect(
  server = "https://rstudio-connect-server",
  key = Sys.getenv("CONNECT_API_KEY"),
)

Note the use of an environment variable to ensure that the API key is not stored in plain text in the document.

Customizing

A pin is displayed in RStudio Connect with an auto-generated page showcasing instructions for getting the pin and a preview of the dataset, this page can be customized as follows:

  1. Locate the file with system.file("views/data/index.html", package = "pins")

  2. Copy the file to a new location and make any changes to it.

  3. Set the file path as an option using Sys.setenv(RSCONNECT_HTML_PATH = <your index>).

  4. Pin a dataset normally.

See also

Examples

if (FALSE) { # the following examples require an RStudio Connect API key # register from rstudio board_register_rsconnect() # register from rstudio with multiple servers board_register_rsconnect(server = "https://rstudio-connect-server") # register from rstudio with multiple account board_register_rsconnect(account = "account-name") # register automated report for rstudio connect board_register_rsconnect( key = Sys.getenv("CONNECT_API_KEY"), server = Sys.getenv("CONNECT_SERVER") ) }