*disclaimer
1379069
R
Rstudio
Quarto
ダウンロードとインストール
RStudioの中にquatroが含まれている
RStudioとは独立してquatroをインストールする
https://quarto.org/docs/get-started/
よく使うヘッダー
---
title: "タイトルです"
subtitle: "副題ですね"
abstract: "概要を文章で"
author: "sugiura"
date: now
date-format: "YYYY-MM-DD HH:mm"
format:
html:
toc: true
number-sections: true
editor: source
Windowsの場合、以下のLocale問題あり
- 実際は無視してOK
Locale 'Japanese_Japan.932' is unsupported, and may crash the interpreter.
HTML出力はOK
対策
- RStudioのターミナルで以下を実行
$Env:LC_ALL="C" $Env:LANG="C"
RMarkdownからの移行
RStudio内で変換コマンド実行
- Tools → Terminal → New Terminal
- quarto convert Original.Rmd
RStudioではじめる
quartoパッケージをインストール
- RMarkdown文書と同様に、Quarto Documentを選んで作成する
- KnitではなくてRenderする
- HTMLファイル作成
- 全体をPDFで本にする場合は Build > Build All
- ただし、Windowsではシステムロケール問題あり
Quartoで本を書く
- book プロジェクトという専用形式あり
- 以前、New Project > Quarto Bookと選べたことがあるが今はない
- book projectにすると、複数のドキュメントを包括して「本」にまとめることができる。
- 例えば、index.qmdとか
Webサイトを構築する
quarto render
- これで _site フォルダーができて、その中にhtmlファイルが生成される
quarto preview でローカルで確認できる
執筆
source と visual
- モードの切り替えは左上のタグ
注意点
Dropboxの同期
- Build Bookするときにエラーになるので、一時停止にする。
References
https://note.com/igjit/n/n989268141be9
https://r4ds.hadley.nz/quarto
https://qiita.com/kojix2/items/2aae818cfa9bbb68087f
https://www.jaysong.net/RBook/quarto.html
https://rstudio-conf-2022.github.io/get-started-quarto/
https://sugiura-ken.org/wiki/