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
\documentclass{ltjsarticle} | |
\usepackage{luatexja} | |
\let\ifdraft\relax % おまじない | |
\usepackage{animate} | |
\title{PDFレポートでアニメーション} | |
\author{@kohske} | |
\begin{document} | |
\maketitle |
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
## ----include=FALSE------------------------------------------------------- | |
library(knitr) | |
opts_chunk$set(tidy=TRUE) | |
## ----平均しますね-------------------------------------------------------------- | |
Mean <- function(x) { | |
y <- |
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
(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))))) |
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
# RmdからWordへ | |
と見せかけて、ホントはTikz推しの話。 | |
## RmdからWordへの変換 | |
@teramonagiさんのTokyo R #36での発表 | |
http://www.slideshare.net/teramonagi/tokyo-r36-20140222 |
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
unlockBinding("to_deck", asNamespace("slidify")) | |
f <- function (doc) | |
{ | |
txt = str_split_fixed(read_file(doc), "\n---", 2) | |
meta = yaml.load(gsub("^---\n+", "", txt[1])) | |
meta <- lapply(meta, iconv, "utf8", "sjis") | |
cfile = ifelse(is.null(meta$config), "config.yml", meta$config) | |
deck = modifyList(get_config(cfile), c(meta, slides = txt[2])) | |
deck$standalone = ifelse(deck$mode == "standalone", TRUE, | |
FALSE) |
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
# ↓CP932 | |
> txt <- "あa" | |
> txt | |
[1] "あa" | |
> Encoding(txt) | |
[1] "unknown" | |
> charToRaw(txt) |
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
install.packages("devtools") | |
library(devtools) | |
dev_mode() | |
install_github("kohske/markdown@fix/encode") | |
install_github("kohske/slidify@fix/encode") | |
install_github("kohske/knitrBootstrap@fix/encode") | |
library(knitr) | |
knit2html("test-knit-CP932.Rmd", encoding="CP932") | |
knit2html("test-knit-UTF8.Rmd", encoding="UTF8") |
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
Person <- R99Class("Person", | |
public : { | |
name = NA | |
hair = NA | |
# initialize | |
initialize = function(name, hair) { | |
if (!missing(name)) self$name <- name | |
if (!missing(hair)) self$hair <- hair |
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
library(rgl) | |
pie3d <- function(x, depth = 0.2, webgl = TRUE) { | |
x = cumsum(x)/sum(x) | |
ps = embed(c(0, 2*pi*x), 2) | |
for (i in 1:nrow(ps)) { | |
p = seq(ps[i, 2], ps[i, 1], by = 2*pi/360) | |
rgl.triangles(rep(c(t(cbind(embed(sin(p), 2), 0))), 2), |
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
> sessionInfo() | |
R version 3.1.1 (2014-07-10) | |
Platform: x86_64-apple-darwin13.1.0 (64-bit) | |
locale: | |
[1] ja_JP.UTF-8/ja_JP.UTF-8/ja_JP.UTF-8/C/ja_JP.UTF-8/ja_JP.UTF-8 | |
attached base packages: | |
[1] stats graphics grDevices utils datasets methods base |
OlderNewer