library(ggplot2)
x=c("vs","cyl","carb","gear")
for (i in x){print(ggplot(aes(x=disp,y=mpg),data=mtcars)+geom_point()+facet_grid(~eval(parse(text=i))))}
g=ggplot(mtcars,aes(disp,hp))+geom_point()
library(plotly)
ggplotly(g)
library(c3)
data <- a="abs(rnorm(<span" class="hljs-number" data.frame="" style="box-sizing: border-box; color: #009999;">20->
) *
10),
b = abs(rnorm(
20) *
10),
date = seq(as.Date(
"2014-01-01"), by =
"month", length.out =
20))
c3(data)
data
## a b date
## 1 9.1235995 4.2780519 2014-01-01
## 2 8.2008122 6.6147801 2014-02-01
## 3 12.6035213 8.9196467 2014-03-01
## 4 1.3809586 16.1538124 2014-04-01
## 5 7.3775932 2.5093076 2014-05-01
## 6 1.3031731 3.8817266 2014-06-01
## 7 5.9879746 6.4995577 2014-07-01
## 8 0.4103167 8.5957655 2014-08-01
## 9 8.2412447 4.0775252 2014-09-01
## 10 7.1714744 4.5246730 2014-10-01
## 11 6.8881768 23.5198349 2014-11-01
## 12 9.1131862 0.6993475 2014-12-01
## 13 13.0415980 7.8385219 2015-01-01
## 14 2.7926127 9.8933458 2015-02-01
## 15 0.3666176 1.0129017 2015-03-01
## 16 2.0317694 5.8011278 2015-04-01
## 17 9.3020233 37.9677456 2015-05-01
## 18 6.7936640 2.7770739 2015-06-01
## 19 15.1637140 11.1787113 2015-07-01
## 20 13.8463555 2.6137495 2015-08-01
c3(iris)
data.frame(sugar = 20,
fat = 45,
salt = 10) %>%
c3() %>%
c3_pie()
data.frame(sugar = 20,
fat = 45,
salt = 10) %>%
c3() %>%
c3_donut(title="Donut plot")
data.frame(data = 80) %>%
c3() %>%
c3_gauge()
data.frame(sugar = 20,
fat = 45,
salt = 10) %>%
c3() %>%
c3_gauge(title="gauge")