create_child_chunk | R Documentation |
create_child_chunk
creates a temporary file that can be read into an .Rmd
file as a child chunk.
create_child_chunk(contents, tmp_dir = ".")
contents |
Character vector where each element is a line that will be included in the temporary file that will be created |
tmp_dir |
Character string with the name of the folder that will contain the temporary file. Default: name of current folder |
Character string with the full name of the temporary file
## Not run:
# snippet of .Rmd file
```{r echo=F}
contents = readLines_part('codefile.R')
tfile = create_child(contents)
```
```{r child=tfile}
```
```{r echo=F}
unlink(tfile)
```
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.