Skip to content

Commit f1907dd

Browse files
committed
update readme
1 parent c1a8767 commit f1907dd

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

README.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# plotly
44

5-
An R package for creating (and modifying) interactive web-based graphs via [plotly](https://plot.ly/)'s API.
5+
An R package for creating (and modifying) interactive web-based graphs via [plotly](https://plot.ly/)'s JavaScript graphing library.
66

77
## Installation
88

9-
__plotly__ is not (yet) available on CRAN, but you can easily install it via [devtools](http://cran.r-project.org/web/packages/devtools/):
9+
__plotly__ is not (yet) available on CRAN, but you can install it via [devtools](http://cran.r-project.org/web/packages/devtools/):
1010

1111
```r
1212
devtools::install_github("ropensci/plotly")
@@ -25,42 +25,52 @@ plotly:::verify("username")
2525
plotly:::verify("api_key")
2626
```
2727

28-
### ggplot2 converter
28+
### Introduction
2929

30-
If you use [ggplot2](http://cran.r-project.org/web/packages/ggplot2/index.html), you can easily convert them to plotly!
30+
If you use [ggplot2](http://cran.r-project.org/web/packages/ggplot2/index.html), simply call `ggplotly()` to make your ggplots online and interactive!
3131

3232
```r
3333
library(plotly)
3434
d <- diamonds[sample(nrow(diamonds), 1000), ]
35-
p <- qplot(carat, price, size = I(4), data = d) + facet_wrap(~cut) +
36-
geom_smooth(aes(colour = cut, fill = cut))
37-
ggplotly(p)
35+
p <- ggplot(data = d, aes(x = carat, y = price)) +
36+
geom_point(aes(text = paste("Clarity:", clarity)), size = 4) +
37+
geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut)
38+
(gg <- ggplotly(p))
3839
```
3940

40-
[![](https://plot.ly/~cpsievert/949.png)](https://plot.ly/~cpsievert/949)
41-
Interact with the Plotly graph: [https://plot.ly/~cpsievert/949](https://plot.ly/~cpsievert/949)
41+
![https://plot.ly/~brnvg/1132](http://imgur.com/tbKybEb)
4242

43+
[Click here](https://plot.ly/~brnvg/1132) to interact with the resulting graph (notice the custom hover text!)
4344

44-
### Custom plotlys
4545

46-
See the vignette entry for an overview of the
46+
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:
4747

48+
```r
49+
layout(gg, hovermode = "closest")
50+
```
4851

49-
## Learn More
52+
plotly also supports certain chart types that ggplot2 doesn't support (such as 3D [surface](https://plot.ly/r/3d-surface-plots/), [point](https://plot.ly/r/3d-scatter-plots/), and [line](https://plot.ly/r/3d-line-plots/) plots). You can easily create these (or any other plotly) charts using the high-level interface.
5053

51-
- [A declarative DSL for the plotly graphing library in R](http://cpsievert.github.io/plotly/dsl/)
52-
- [Plot with ggplot2, interact, collaborate, and share online « Bayesian Biologist](http://bayesianbiologist.com/2014/07/31/plot-with-ggplot2-interact-collaborate-and-share-online/)
53-
- [A Rosetta Stone for R, ggplot2, Python, MATLAB, and Excel Plotting](http://nbviewer.ipython.org/gist/msund/61cdbd5b22c103fffb84)
54+
```r
55+
plot_ly(z = volcano, type = "surface")
56+
```
5457

58+
![https://plot.ly/~brnvg/1134](https://plot.ly/~brnvg/1134.png)
5559

56-
## Stay in touch
60+
## Learn more
5761

58-
59-
- [@plotlygraphs](https://twitter.com/plotlygraphs)
62+
* [An introduction to plotly's R API](http://ropensci.github.io/plotly/intro)
63+
* [Plotly Offline Mode](http://ropensci.github.io/plotly/offline)
64+
* Plotly's [R homepage](https://plot.ly/r) and [ggplot2 homepage](https://plot.ly/ggplot2)
6065

6166
## Contributing
6267

63-
- We love collaboration! See the [code of conduct]() and the [wiki](https://github.com/ropensci/plotly/wiki/Development-guidelines) for more information.
68+
- We love collaboration! See the [wiki](https://github.com/ropensci/plotly/wiki/Development-guidelines) and the [code of conduct](https://github.com/ropensci/plotly/blob/master/CONDUCT.md) for more information.
69+
70+
## Stay in touch
71+
72+
73+
- [@plotlygraphs](https://twitter.com/plotlygraphs)
6474

6575
---
6676

vignettes/intro.Rmd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: "An introduction to plotly's R API"
33
author: "Carson Sievert"
44
output:
5-
pdf_document:
6-
toc: yes
75
html_document:
86
toc: yes
97
vignette: |

0 commit comments

Comments
 (0)