Skip to content

Commit 3398a7e

Browse files
committed
Added plotly data
1 parent 11ad4aa commit 3398a7e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
506 Bytes
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## An analysis of the coursera johns hopkins data (from a few months back)
2+
## Used to illustrate plotly and ggplot
3+
##
4+
## Brian Caffo 7/10/2014
5+
6+
7+
load("courseraData.rda")
8+
9+
10+
## Make sure that you've followed the first few set up steps
11+
## https://plot.ly/ggplot2/getting-started/
12+
## Particularly set_credentials_file(username=FILL IN, api_key=FILL IN)
13+
library(plotly)
14+
15+
16+
library(ggplot2)
17+
## First do a bar plot in ggplot
18+
g <- ggplot(myData, aes(y = enrollment, x = class, fill = offering))
19+
g <- g + geom_bar(stat = "identity")
20+
g
21+
22+
## Let's try to get it into plot.ly
23+
py <- plotly()
24+
out <- py$ggplotly(g)
25+
out$response$url
26+
27+
28+

0 commit comments

Comments
 (0)