| knitr_thread | R Documentation |
Sets up hooks in a knitr document so that it will produce a twitter thread.
knitr_thread(thread, publish = FALSE)
thread |
thread object to populate. |
publish |
Whether the resulting thread should be published. |
This function should be called in the first(ish) chunks of a knitr document.
To add a chunk to a thread, add the option tw_status = "Status of the tweet"
to it. The first figure returned by the chunk (if any) will be attached as media.
## Not run:
```{r, setup}
this_thread <- spindler::thread$new()
spindler::knitr_thread(this_thread, TRUE)
```
```{r, tw_status = "The relationship between pressure and temperature is cool!"}
plot(pressure)
```
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.