Skip to content

Commit 7be340d

Browse files
committed
Updated ggplot2 getting started
fixes plotly#359
1 parent 8bb4062 commit 7be340d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

_posts/ggplot2/getting-started/2015-08-10-getting-started_ggplot2_index.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,31 @@ language: ggplot2
1313
# Plotly for R
1414

1515
Plotly is R package for creating interactive web-based graphs via [plotly](https://plot.ly/)'s JavaScript graphing library, `plotly.js`.
16-
The `plotly` R libary contains a function `ggplotly` which will convert `ggplot2` figures into graphs drawn with `plotly.js` and saved in your online plotly account.
16+
The `plotly` R libary contains a function `ggplotly` which will convert `ggplot2` figures into graphs drawn with `plotly.js` which can be saved to your online plotly account or rendered locally.
1717

1818
<a href="https://travis-ci.org/ropensci/plotly">
1919
<img alt="Build Status" style="margin: 0;" src="https://travis-ci.org/ropensci/plotly.png?branch=master">
2020
</a>
2121

2222
#### Installation
2323

24-
__plotly__ is not (yet) available on CRAN, but you can install it via [devtools](http://cran.r-project.org/web/packages/devtools/):
24+
__plotly__ is now available on CRAN.
25+
26+
```r
27+
install.packages("plotly")
28+
```
29+
30+
To install the **dev** version use:
2531

2632
```r
27-
install.packages("viridis") # dependency
2833
install.packages("devtools")
2934
devtools::install_github("ropensci/plotly")
3035
```
3136

32-
3337
#### Signup
3438

3539
If you don't already have a plotly account, either [signup online](https://plot.ly/ssu/) or use the `signup()` function (see the `help(signup)` page for more details).
3640

37-
Note you can check if you have a username and API key with:
38-
39-
```r
40-
plotly:::verify("username")
41-
plotly:::verify("api_key")
42-
```
43-
4441
#### Credentials
4542

4643
Find your credentials [in our online settings](https://plot.ly/settings/api). Set them in your R session with:
@@ -79,7 +76,7 @@ p <- ggplot(data = d, aes(x = carat, y = price)) +
7976
geom_point(aes(text = paste("Clarity:", clarity)), size = 4) +
8077
geom_smooth(aes(colour = cut, fill = cut)) + facet_wrap(~ cut)
8178

82-
(gg <- ggplotly(p))
79+
ggplotly(p)
8380
```
8481

8582
<iframe height="600" id="igraph" scrolling="no" seamless="seamless" src="https://plot.ly/~RPlotBot/1284.embed" width="800" frameBorder="0"></iframe>
@@ -88,3 +85,9 @@ p <- ggplot(data = d, aes(x = carat, y = price)) +
8885
<a href="/r/" class="button no_underline">View more examples</a>
8986
</div>
9087

88+
#### Publishing graphs to your online plotly account
89+
You can publish your newly created plotly graph to your online plotly account by using `plotly_POST()`.
90+
91+
```r
92+
plotly_POST(p, "Sample Plotly Chart")
93+
```

0 commit comments

Comments
 (0)