For a `.Rmd` doc, you specify the `plotly=TRUE` chunk option. Second, you can make plots as part of an `.Rmd` document or in IPython Notebooks using R. Or in slides, as seen in Karthik Ram's Slidify presentation from useR 2014. First, use iframes to embed in RPubs, blogs, and on websites. Thus, we have three general options to publish interactive plots with your favorite R tools. The RPub shows a Plotly graph of the ggplot2 NBA heatmap from a Learning R post. You can see how the embedded plot looks in the screenshot below. A published RPub from the code above is here. You'll want to press the "publish" button on the generated RPub preview to push the RPub online with a live graph. You can copy and paste this code into RStudio and press "Knit HTML": First, you'll want to open a new R Markdown doc within RStudio. Now let's make a plot in a knitr doc (here's a knitr and RPubs tutorial). Thus, if your ggplot2 plot doesn't precisely translate through to Plotly, you and your team can use the web app to tweak, edit, and style. For all plots you can edit, share, and download data and plots from within a web GUI, adding fits, styling, and more. Your iframe will always show the most up to date version of your plots. Plotting is interoperable, meaning you can make a plot with ggplot2, add data with Python or our Excel plug-in, and edit the plot with someone on your team who uses MATLAB. Click and drag to zoom or hover to see data. We can share the URL over email or Twitter, add collaborators, export the image and data, or embed the plot in an iframe in this blog post. In this case, it's here: if you forked the plot and wanted to tweak and share it, a new version of the plot would be saved into your profile. The plot, data, and code for making the plot in Julia, Python, R, and MATLAB are all online and editable by you and your collaborators. Ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)Īdding py$ggplotly() to your ggplot2 plot creates a Plotly graph online, drawn with D3.js, a popular JavaScript visualization library. Py <- plotly(username="r_user_guide", key="mw5isa4yqp") # open plotly connection Install_github("ropensci/plotly") # plotly is part of ropensci Install.packages("devtools") # so we can install from github
0 Comments
Leave a Reply. |