I can't seem to render a Quarto HTML document when calling functions from specific packages (so far I've identified the problem when using kableExtra as well as when using ggiraph) in a project that is using renv.
Here are the steps to reproduce. This example uses kableExtra but similar errors occur when using ggiraph:
(1) Using the RStudio graphical interface, create a new project, clicking the option to use renv (I'm using renv 0.15.5).
(2) Using the RStudio graphical interface, create a new Quarto file. Follow the prompt to install the rmarkdown package.
(3) Install kableExtra using the console: install.packages('kableExtra')
(4) Write a Quarto document:
---
title: "Untitled"
format: html
editor: visual
---
## Title
```{r}
mtcars |>
kableExtra::kbl()
```
(5) (At this point, the code chunk runs perfectly and generates the expected output when I run it interactively).
(6) Save script as test.qmd
in the root of the project directory
(7) Press Render. Error message:
Error in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="test_files\libs/kePrint-0.0.1": The system cannot find the path specified
Calls: .main ... html_dependencies_as_string -> lapply -> FUN -> normalizePath
In addition: Warning messages:
1: In dir.create(outputDir) :
cannot create dir 'test_files\libs', reason 'No such file or directory'
2: In dir.create(target_dir) :
cannot create dir 'test_files\libs\kePrint-0.0.1', reason 'No such file or directory'
Execution halted
(8) The project renders as expected if I deactivate renv using renv::deactivate()
and then press Render.
Operating system: Windows 10
RStudio verison: ‘2022.7.0.548’, "Spotted Wakerobin"
R platform: x86_64-w64-mingw32
R version: 4.2.1 (2022-06-23 ucrt), Funny-Looking Kid