Last active
December 31, 2015 02:49
-
-
Save kohske/7923794 to your computer and use it in GitHub Desktop.
Rstudio + Rpres + googleVisのマークダウンファイル。簡単ですね。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rstudio + Rpres + googleVis | |
======================================================== | |
author: @kohske | |
date: 2013/12/12 | |
とりあえずプロット | |
======================================================== | |
```{r, echo=FALSE, results='asis', warning=FALSE, message=FALSE} | |
library(googleVis) | |
df <- data.frame(country=c("US", "GB", "BR"), | |
val1=c(1,3,4), | |
val2=c(23,12,32)) | |
Bar1 <- gvisBarChart(df, xvar="country", yvar=c("val1", "val2")) | |
print(Bar1, "chart") | |
``` | |
<br/> | |
マウスオーバーでデータ数値出せるよ! | |
表もね | |
======================================================== | |
```{r, echo=FALSE, results='asis', warning=FALSE, message=FALSE} | |
tbl1 <- gvisTable(Population[1:30, ], options=list(width=800)) | |
print(tbl1, "chart") | |
``` | |
<br/> | |
ヘッダクリックでソートできるよ! | |
結論 | |
======================================================== | |
- なかなか良い。 | |
- せっかくHTML5スライドつくるなら、base graphicsとかggplot2とかのプロットを画像出力して貼り付けるよりも、javascriptベースのビジュアライゼーション()ライブラリを使う方が良い。 | |
- 次はrChartと組み合わせてみましょう。 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment