knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(atusydown)

Show source chunk asis

By specifying opts.include = TRUE, the source chunk returns the chunk including its option except for opts.include. Note a limitation that collapse is ignored.

R chunk

```r"`
1
```

gives

1

Similary labelled chunk gives

1

And chunk options starting without comma gives

1

Note that chunk without codes will not be echoed, which is probably a default behavior of R Markdown.

Shell chunk

```{sh, opts.include = TRUE} echo "hello"

### Chunks using extra engines in atusydown

Currently, engines `glue` and `opts` do not support `opts.include`.

## Measuring elapsed time in a chunk

A chunk option with `time = TRUE` returns elapsed time.
Specify an integer to `time.digits` to round the time.
Otherwise the time rounded by `signif()`.

````
```r"`
`r knitr:::knit_code$get("time")`

````

Sys.sleep(time = 1e-2)


atusy/atusydown documentation built on Sept. 1, 2020, 3:37 a.m.