\newpage
require(knitr) require(tidyverse) # グラフの標準フォント設定 # うまく行かない場合は手動で設定してください rmdja::set_graphics_font(rmdja::get_default_font_family("lualatex")["serif"])
文書の作成には rmarkdown
および bookdown
パッケージ [@R-rmarkdown;@R-bookdown] が必要である. citr
, clipr
も執筆に役立つパッケージである.
第 \@ref(related-works) 節は先行研究のサーベイである. 第 \@ref(methodology) 節は今回提起する問題とその解決方法である. 第 \@ref(experiment) 節は実験内容である. 第 \@ref(conclusions) 節は結論である.
最も充実したドキュメントは開発メンバーの謝益輝 (Yihui) 氏らによる以下の3つである.
bookdown
: Authoring Books and Technical Documents with R Markdown"このサンプルを動かすには knitr
[@R-knitr], tidyverse
[@R-tidyverse] が必要である.
図 \@ref(fig:plot) が結果である.
(ref:ggplot-example-article) ggplot2
を使用したデータのプロット
ggplot(mutate(mtcars, cyl = factor(cyl)), aes(x = mpg, y = wt, color = cyl)) + geom_point() + labs(x = "マイル毎米ガロン", y = "重量 (1000ポンド)") + theme_bw(base_family = rmdja::get_default_font_family("lualatex")["serif"]) + scale_color_grey() + scale_fill_grey()
表\@ref(tab:table-example)を見よ.
knitr::kable(head(mtcars[, 1:4]), booktabs = T, caption = "表の例", format = "pipe")
このファイルの出力例は以下のコマンドでコピーすることができます.
file.copy(system.file("resources/examples/templates/pdf_article_ja/", package = "rmdja"), "./", recursive = T)
# ファイルの上書きに注意 # 本文中で引用があれば参考文献セクションが末尾に自動で生成される. knitr::write_bib(c("rmarkdown", "knitr", "tidyverse", "bookdown"), file = 'packages.bib')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.