RMarkdown を使用して blogdown 経由でブログを作成しています。たとえば、埋め込みツイートを含めたいと思います。以下のように:
<blockquote class="twitter-tweet" data-partner="tweetdeck">
<p lang="en" dir="ltr">Section 1.5 uses the gutenbergr package to pull literary text. Unfortunately, the function doesn't get through our work firewall.</p>— Jeremy GH (@JGreenbrookHeld)
<a href="https://twitter.com/JGreenbrookHeld/status/912774476533719040?ref_src=twsrc%5Etfw">September 26, 2017</a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
評価されるRコードを含める方法は知っていますが、HTMLコードのブロックに貼り付けて直接渡す方法はわかりません。任意のヒント?
例として、単純な RMarkdown ドキュメントがあります。
---
title: "Test"
author: "Mark Ewing"
date: "October 2, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
<blockquote class="twitter-tweet" data-partner="tweetdeck">
<p lang="en" dir="ltr">Section 1.5 uses the gutenbergr package to pull literary text. Unfortunately, the function doesn't get through our work firewall.</p>— Jeremy GH (@JGreenbrookHeld)
<a href="https://twitter.com/JGreenbrookHeld/status/912774476533719040?ref_src=twsrc%5Etfw">September 26, 2017</a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
ドキュメントの途中に HTML を挿入すると、次のエラーが発生します。
pandoc.exe: Could not fetch //platform.twitter.com/widgets.js
//platform.twitter.com/widgets.js: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\u772700\Documents\R\win-library\3.4\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\u772700\AppData\Local\Temp\RtmpK4i4dH\rmarkdown-str30e47033f51.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"' had status 67
Execution halted
最初にコード マーカー ``` でラップすると、html をレンダリングする代わりにブロック引用符で囲みます。