[Bioc-devel] EXTERNAL: LazyData: false and accessing data in the YAML section of an Rmd document
Witold Wolski
wew @end|ng |rom |gcz@ethz@ch
Mon Nov 22 11:16:33 CET 2021
Dear Andrew,
Thanks for your suggestion.
Loading the data explicitly in the markdown instead of the YAML section
- appeals to me. It is desirable to show the code in the vignette if the
vignette loads it.
However, I would like not to display the code if I pass the data using
the params argument of the `render` function.
Therefore, I thought about the following code, which unfortunately
Errors with BiocCheck.
```{r data-fonfig, include=FALSE}
evalAll <- is.null(params$data)
if(!evalAll ){
data <- params$data
}
```
```{r eval = evalAll}
data(data_ionstar, package = "prolfqua")
data <- data_ionstar$data
```
Running BiocCheck produces:
* Checking library calls...
Error in eval(x, envir = envir) : object 'evalAll' not found
Best regards
Witek
On 19/11/2021 17:00, McDavid, Andrew wrote:
> How about in the YAML:
>
> params:
> configuration: NULL
> project_conf: NULL
> data: NULL
>
>
> Then in the first chunk something like:
> ```{r data-config}
> if(is.null(params$data)){
> data(data_ionstar, package = "prolfqua")
> data = data_ionstar
> configuration = data$filtered()$config
> }
> ```
>
>
> You can use a more ornate expression for these parameters when rendering
> otherwise `rmarkdown::render()`, which I suppose you could call from a
> Makefile if needed when rendering package the vignettes.
>
> Andrew McDavid
>
> Biostatistics and Computational Biology
> University of Rochester Medical Center
>
>> On Nov 19, 2021, at 6:00 AM, bioc-devel-request using r-project.org
>> <mailto:bioc-devel-request using r-project.org> wrote:
>>
>> If anyone wonders, why do I need it. By this I can reuse the vignette
>> with a different dataset.
>
More information about the Bioc-devel
mailing list