More Related Content
Similar to R Markdownによるドキュメント生成と バージョン管理入門 (20)
R Markdownによるドキュメント生成と バージョン管理入門
- 4. 本⽇の流れ
1. R Markdownとは
2. R Markdownによるレポーティングの利点
3. R Markdownによるレポーティングの手続き
4. R Markdownの実習と質疑応答
5. GitHub Desktopを用いたバージョン管理入門
4 / 87
- 6. 特にR Markdown: The Definitive Guideは必読!
https://bookdown.org/yihui/rmarkdown/
6 / 87
- 30. 個⼈的によく使うYAMLヘッダ項⽬
---
title: "CAPS_RMarkdown"
subtitle: "hogehoge"
author: "Yasunori Kinosada"
date: "2018-08-24" #自動で本日の日付を取得するなら、`r Sys.Date()`
output:
rmdformats::readthedown:
highlight: zenburn #コードシンタックスのハイライト方法
md_extensions: -ascii_identifiers #日本語で書いている場合はおまじない
self_contained: true #jsやcss,画像データなどをhtmlファイルに埋め込む
lightbox: true #画像をクリックしたらポップアップさせる
toc: true #メニュー(toc: table of contents)を設ける
toc_float: true #tocを設けた場合に、ページ冒頭ではなく、サイドメニュー化
toc_depth: 3 #tocに反映させる見出しの階層数
---
もちろん他にもたくさんある
30 / 87
- 35. {knitr}パッケージがサポートしている
⾔語エンジン⼀覧
names(knitr::knit_engines$get())
## [1] "awk" "bash" "coffee" "gawk" "groovy"
## [6] "haskell" "lein" "mysql" "node" "octave"
## [11] "perl" "psql" "Rscript" "ruby" "sas"
## [16] "scala" "sed" "sh" "stata" "zsh"
## [21] "highlight" "Rcpp" "tikz" "dot" "c"
## [26] "fortran" "fortran95" "asy" "cat" "asis"
## [31] "stan" "block" "block2" "js" "css"
## [36] "sql" "go" "python" "julia"
35 / 87
- 47. 表の⽣成
方法1:knitr::kable()(とりあえずこれでいい)
knitr::kable(x = head(mtcars, 2),
format = "html",
digits = 2,
align = "c",
caption = "two rows of mtcars dataset")
two rows of mtcars dataset
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda
RX4
21 6 160 110 3.9 2.62 16.46 0 1 4 4
Mazda
RX4 Wag
21 6 160 110 3.9 2.88 17.02 0 1 4 4
47 / 87