knitr_thread: Setup a knitr document to compose a thread

View source: R/knitr_thread.R

knitr_threadR Documentation

Setup a knitr document to compose a thread

Description

Sets up hooks in a knitr document so that it will produce a twitter thread.

Usage

knitr_thread(thread, publish = FALSE)

Arguments

thread

thread object to populate.

publish

Whether the resulting thread should be published.

Details

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.

Examples

## 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)


eliocamp/spindler documentation built on Jan. 31, 2023, 5:49 a.m.