LoginSignup
7

More than 5 years have passed since last update.

R Markdownで標準で組み込まれてるテーマ切替

Last updated at Posted at 2015-12-06

この記事の目的

私が大好きなRMarkdownについて、Tipsを集中的に連載しようという思いつきの企画です。あと自分の中で進めている別企画のメモという位置づけでもあります。なので大した中身はありません

R Markdownとは

Markdown記法をベースに、チャンクという形でRのコードを記述して評価・出力することができるものです。RStudioのクイックリファレンスでは以下のように説明してあります:

R Markdown is an easy-to-write plain text format for creating dynamic documents and reports.

R Markdownで標準に組み込まれているテーマ

実はあまり知られてない気がしますが、R Markdownには標準でテーマ切替機能があります。R Markdown Reference(pdf)には、以下の記載があります:

Bootswatch or Beamer theme to use for page. Valid bootswatch themes include
"cerulean", "journal", "flatly", "readable", "spacelab", "united", and "cosmo".

つまり、Bootswachのテーマのうち、上述のテーマを利用可能だというわけですね。導入するにはRmdファイルの冒頭にあるyamlに以下のように記述すればOKです:

---
title: "Untitled"
output:
  html_document:
    theme: flatly
---

どんな感じになるかは、ぜひ自分で試してみてください。

Enjoy!

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7