Show Sidebar Hide Sidebar

Updating Plotly Graphs in R in R

R Filenames, folders, and updating Plotly graphs in the plotly cloud.

New to Plotly?

Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!

Version Check

Version 4 of Plotly's R package is now available!
Check out this post for more information on breaking changes and new features available in this version.

library(plotly)
packageVersion('plotly')
## [1] '4.5.6.9000'

Save Plot to Server

To create a plotly figure on a plotly server, use plotly_POST().

library(plotly)
p <- plot_ly(x = c(1, 2), y = c(1, 2))
plotly_POST(p)

Overwrite Plot

If you don't include a filename, a new plot will be made on your online plotly account. If you want to overwrite a plot (i.e., keep the graph served from the same plotly URL), specify a filename. This implicitly overwrites your plotly graph.

plotly_POST(p, filename = "name-of-my-plotly-file")

Save your Plot in a Folder

If the filename contains "/", it will automatically create a plotly folder. This option is only available for Pro-Subscriptions

plotly_POST(p, filename="r-docs/name-of-my-plotly-file")

View your Plotly graphs at https://plot.ly/organize.

Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.