create_child_chunk: create_child_chunk

create_child_chunkR Documentation

create_child_chunk

Description

create_child_chunk creates a temporary file that can be read into an .Rmd file as a child chunk.

Usage

create_child_chunk(contents, tmp_dir = ".")

Arguments

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

Value

Character string with the full name of the temporary file

Examples

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

HanOostdijk/HOQCutil documentation built on July 28, 2023, 5:56 p.m.