これは php や他の言語で実行できることは知っていますが、knitr を使用して次のことが達成できるかどうか疑問に思っていました。
2 つの見出し 1 セクションを持つ Rmarkdown (.rmd) ドキュメントがあるとします。
# This is the first heading for the first document
Lorem ipsum dolor sit amet
# This is the second heading for the first document
plot(object)
質問 1: 別の .rmd ドキュメントを開く場合、このドキュメントを解析したときに、最初のドキュメントのコンテンツ全体だけでなく、そのコンテンツも表示するようにリンクを作成するにはどうすればよいですか。例えば:
# This is the first heading for the second document Lorem ipsum dolor sit amet [command goes here to insert the first document]
結果は次のようになります。
# This is the first heading for the second document Lorem ipsum dolor sit amet # This is the first heading for the first document Lorem ipsum dolor sit amet # This is the second heading for the first document [plot shows up here]
質問 2: Knitr を使用すると、ドキュメント 1 の選択した部分のみを選択してドキュメント 2 に挿入できますか? たとえば、見出し 1 とその下のコンテンツのみ、または見出し 2 とそのプロットのみ