Black Lives Matter. Please consider donating to Black Girls Code today.

Privacy Settings For Chart Studio Graphs in R

How to set the privacy settings of Chart Studio graphs in R.


Building AI apps or dashboards in R? Deploy them to Dash Enterprise for hyper-scalability and pixel-perfect aesthetic.
10% of the Fortune 500 uses Dash Enterprise to productionize AI & data science apps.
Find out if your company is using Dash Enterprise

Install Dash Enterprise on Azure | Install Dash Enterprise on AWS


New to Plotly?

Plotly is a free and open-source graphing library for R. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.

Default Privacy

The plotly R package renders plots entirely locally by default.

However, you can also choose to publish plots on the web using Chart Studio via the api_create() function.

By default, the api_create() function creates public graphs. With a Chart Studio Enterprise subscription, you can easily make graphs private by using the sharing argument of the api_create() function.

Public Graph

Please note, this is the default privacy option.

library(plotly)
p <- plot_ly(x = c(0, 2, 4), y = c(0, 4, 2), type = 'scatter', mode = 'markers+lines')
chart_link = api_create(p, filename = "public-graph")
chart_link

Below is the URL of this public plot. Anyone can view public plots even if they are not logged into Plotly.
Try it out: https://plotly.com/~RPlotBot/4545

Private Graph

library(plotly)
p <- plot_ly(x = c(0, 2, 4), y = c(0, 4, 2), type = 'scatter', mode = 'markers+lines')
chart_link = api_create(p, filename = "private-graph", sharing = "private")
chart_link

Below is the URL of the private plot above. Only the owner can view the private plot. You won't be able to view this plot.
Try it out: https://plotly.com/~RPlotBot/4549/

Secret Graph

library(plotly)
p <- plot_ly(x = c(0, 2, 4), y = c(0, 4, 2), type = 'scatter', mode = 'markers+lines')
secret_graph = api_create(p, filename = "secret-graph-file", sharing = "secret")
secret_graph

Below is the URL of this secret plot. Anyone with the secret link can view this chart. However, it will not appear in the Plotly feed, your profile, or search engines.
Try it out: https://plotly.com/~RPlotBot/4553/?share_key=62AMQ8YBpZebu6Y5OYsukj