This file contains hidden or 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
| ```{r setup} | |
| library(xtable) | |
| library(ggplot2) | |
| library(gridExtra) | |
| options(xtable.type = "html") | |
| ``` | |
| ```{r table1, results='asis'} | |
| xtable(head(iris)) |
This file contains hidden or 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
| library(ggplot2) | |
| library(proto) | |
| StatSummary <- proto(ggplot2:::Stat, { | |
| objname <- "summary" | |
| default_geom <- function(.) GeomPointrange | |
| required_aes <- c("x", "y") | |
| calculate_groups <- function(., data, scales, fun.data = NULL, fun.y = NULL, fun.ymax = NULL, fun.ymin = NULL, na.rm = FALSE, ...) { | |
| data <- remove_missing(data, na.rm, c("x", "y"), name = "stat_summary") | |
| if (!missing(fun.data)) { | |
| fun.data <- match.fun(fun.data) |
This file contains hidden or 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
| library(XML) | |
| # 負荷軽減のため | |
| if (length(dir(".", "^data.Rda$")) == 0) { | |
| data <- xmlToDataFrame("http://www3.city.sabae.fukui.jp/xml/population/population.xml", | |
| stringsAsFactors=FALSE, | |
| colClasses=c("integer","integer","character", | |
| "numeric","numeric","numeric", | |
| "numeric","character")) | |
| save("data", file = "data.Rda") |
This file contains hidden or 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
| <!doctype HTML> | |
| <meta charset = 'utf-8'> | |
| <html> | |
| <head> | |
| <script src='http://polychart.com/s/third_party/polychart2.standalone.js' type='text/javascript'></script> | |
| <style> | |
| .rChart { | |
| display: block; |
This file contains hidden or 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
| h <- rnorm(1000, 160, 10) | |
| w <- rnorm(1000, 0, 10)/(pmin(abs(h-160), 1)) + (h-60)*0.75 | |
| d <- data.frame(x=w, y=h) | |
| p <- ggplot(data=d, aes(x=x,y=y)) + geom_point(colour = "gray50", alpha=0.5, size = 5) | |
| mapping <- aes(x=x, | |
| y=y, | |
| scale=scale, | |
| ratioxy=ratioxy, | |
| angleofspine = angleofspine, |
This file contains hidden or 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) |
This file contains hidden or 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
| --- | |
| title : はじめてのslidify | |
| subtitle : マークダウンで楽々HTML5スライド作成 | |
| author : "@kohske" | |
| job : | |
| framework : io2012 # {io2012, html5slides, shower, dzslides, ...} | |
| highlighter : highlight.js # {highlight.js, prettify, highlight} | |
| hitheme : tomorrow # | |
| widgets : [mathjax] # {mathjax, quiz, bootstrap} | |
| mode : standalone # {selfcontained, standalone, draft} |
This file contains hidden or 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
| \documentclass{ltjsarticle} | |
| \usepackage{luatexja} | |
| \let\ifdraft\relax % おまじない | |
| \usepackage{animate} | |
| \title{PDFレポートでアニメーション} | |
| \author{@kohske} | |
| \begin{document} | |
| \maketitle |
This file contains hidden or 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
| ## ----include=FALSE------------------------------------------------------- | |
| library(knitr) | |
| opts_chunk$set(tidy=TRUE) | |
| ## ----平均しますね-------------------------------------------------------------- | |
| Mean <- function(x) { | |
| y <- |
This file contains hidden or 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
| (defun rmarkdown-to-html () | |
| "Run knitr::knit2html on the current file" | |
| (interactive) | |
| (shell-command | |
| (format "Rscript -e \"knitr::knit2html('%s')\"" | |
| (shell-quote-argument (buffer-file-name))))) |