Skip to contents

Reads the code of a named knitr chunk (via the public `knitr::knit_code` API) and passes it to [ch_hover()]. This keeps the source document clean: write the plot in a normal chunk with `eval=FALSE`, then call `ch_hover_chunk("<label>")` inline or in a later chunk.

Usage

ch_hover_chunk(label, ...)

Arguments

label

(string) The chunk label.

...

Passed on to [ch_hover()].

Value

See [ch_hover()].

Examples

if (FALSE) { # \dontrun{
# ```{r myplot, eval=FALSE}
# ggplot(mtcars, aes(wt, mpg)) +
#   geom_point()
# ```
# `r ch_hover_chunk("myplot")`
} # }