====== RMarkdownでレポート作成 ====== [[00.初めての医療統計rとezr:index.html|初めての医療統計RとEZRトップページ]] ===== RStudioでRNotebookで統計解析と同時にレポート作成 ===== R version 4.1.0 (2021-05-18) RStudio Version 1.4.1717 RStudioで画面を黒くする方法 Tools > Global Options , Appearanceで、Editor themeでVibrant Ink を選択して、OK File > New File > R Notebook で、R Notebookを作成した後、冒頭のYAMLヘッダーを、以下のように書き換える --- title: "タイトル" author: "なまえ" created_at: 2021/8/3 updated_at: '`r format(Sys.time(), "%Y/%m/%d %H:%M")`' output: html_document: df_print: paged fig_caption: yes number_sections: yes pandoc_args: - --from - markdown+autolink_bare_uris+tex_math_single_backslash-implicit_figures self_contained: true toc: true toc_float: true --- このようにすると、 -html出力 -更新日が自動挿入 -目次が自動挿入 となる。 RNotebookを編集中に目次を出したい場合は、以下のようにする -画面上の『Knit』ボタンの右側の『歯車』ボタン>Use Visual Editorをクリック(or Ctrl+Shift+F4)(数十秒時間がかかる) -Visual Editorになり、横に目次が現れるので、再度、Ctrl+Shift+F4で、Visual Editorをoffにする -すると、Visual Editorはoffになるが、横の目次はそのまま残る ===== Rmdからpurl関数でRコードを抜く ===== https://teramonagi.hatenablog.com/entry/20150228/1425086330 2015-02-28 RmdファイルからRコードを抜くのはpurl関数 getwd() list.files() purl("210806_001.Rmd") ===== RMarkdownについて ===== https://www.jaysong.net/rmarkdown-intro/ R Markdown入門 https://kazutan.github.io/kazutanR/Rmd_intro.html R Markdown入門 https://gihyo.jp/admin/serial/01/r-markdown 連載 R Markdownで楽々レポートづくり 高橋康介 https://qiita.com/tomotagwork/items/c92fb40a76f56ea16aa4 @tomotagwork 2019年11月02日に更新 R Markdownによるレポート生成 https://qiita.com/kazutan/items/024b7b7176b1f70582ed @kazutan 2015年12月09日に投稿 R MarkdownでKnitした日付を自動的に挿入 https://gedevan-aleksizde.github.io/rmarkdown-cookbook/ R Markdown クックブック https://ill-identified.hatenablog.com/entry/2020/09/05/202403 2020-09-05 2020-11-09T10:21:28+09:00 [R] R Markdown の YAML ヘッダでハマったおまえのための記事 ===== YAMLヘッダ ===== --- title: "タイトル" date: "最終修正: `r Sys.time()`" output: html_document: md_extensions: -ascii_identifiers toc: true # table of content true toc_depth: 3 number_section: true --- https://www.it-swarm-ja.com/ja/r-markdown/rmarkdown-knit%E3%81%A7r%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E9%9D%9E%E8%A1%A8%E7%A4%BA%E3%81%AB%E3%81%97%E3%80%81%E7%B5%90%E6%9E%9C%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B/1068728644/ 2)チャンクを非表示にします(グローバル)。 knitr::opts_chunk$set関数を使用して、knitrのデフォルトの動作を変更できます。ドキュメントの最初にこれを呼び出し、include=FALSEをチャンクヘッダーに含めて、出力を抑制します。 --- output: html_document --- ```{r include = FALSE} knitr::opts_chunk$set(echo=FALSE) ``` ```{r} plot(cars) ``` ===== Rでスライド作成 ===== reveal.jsがよさそう。 pptxでも出力できる https://kazutan.github.io/SappoRoR6/rmd_slide.html#/ R Markdownによるスライド生成 前田和寛(@kazutan) 2016/07/09 https://mana.bi/wiki.cgi?page=%A5%AD%A5%EF%A4%E1%A4%EB%A1%AAR%A4%C7%A5%D7%A5%EC%A5%BC%A5%F3%A5%C6%A1%BC%A5%B7%A5%E7%A5%F3 キワめる!Rでプレゼンテーション 2019年10月13日 https://qiita.com/nozma/items/bbd681490b2aaaf9ec93 @nozma が2019年04月11日に更新 RStudioとRMarkdownで作るPowerPointプレゼンテーション https://tam07pb915.wordpress.com/2019/03/02/infinite-moon-reader/ Rmarkdownでスライド作るときのリアルタイムプレビュー https://qiita.com/tomo_makes/items/aafae4021986553ae1d8 @tomo_makes が2020年07月12日に更新 【VS Code + Marp】Markdownから爆速・自由自在なデザインで、プレゼンスライドを作る https://blog.atusy.net/2019/08/11/revealjs-2col-inline-block/ Rmd + Revealjs で簡単に印刷もできる2カラムレイアウトを実現する (inline-block) 2019-8-11 by Atusy ===== xaringanのインストール(revealjs系統) ===== https://qiita.com/nozma/items/21c56c7319e4fefceb79 nozma が2019年03月10日に更新 xaringanによるスライド作成入門 install.packages("xaringan") ===== リンク ===== [[00.初めての医療統計rとezr:index.html|初めての医療統計RとEZRトップページ]] 前: 次: