cldougl / plotly

Create interactive web graphics from R via plotly's JavaScript graphing library

Home Page:https://plot.ly/r/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

plotly

An R package for creating interactive web-based graphs via plotly's JavaScript graphing library.

Installation

Install from CRAN:

install.packages("plotly")

Or install the latest development version (on GitHub) via devtools:

devtools::install_github("ropensci/plotly")

Introduction

If you use ggplot2, use ggplotly() to convert your ggplot to an interactive, web-based version!

library(plotly)
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]
p <- ggplot(data = d, aes(x = carat, y = price)) + 
  geom_point(aes(text = paste("Clarity:", clarity))) +
  geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut)
(gg <- ggplotly(p))

https://plot.ly/~agvd/1153

Click here to interact with the resulting graph (notice the custom hover text!)

plotly also supports certain chart types that ggplot2 doesn't support (such as 3D surface, point, and line plots). You can easily create these (or any other plotly) charts using the high-level interface.

plot_ly(z = volcano, type = "surface")

https://plot.ly/~brnvg/1134

The ggplotly() function converts a ggplot object to a plotly object, so if you like, you may 'post-process' your ggplot graphs to add custom plotly features, for example:

layout(gg, hovermode = "closest")

Documentation

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, asking questions, contributing changes to plotly, and our code of conduct.


About

Create interactive web graphics from R via plotly's JavaScript graphing library

https://plot.ly/r/

License:Other


Languages

Language:R 99.8%Language:JavaScript 0.2%