I'm trying to write an article in Quarto/rmarkdown from within a package. The package will include functions and data pertaining to the article. The package documentation is being generated with pkgdown
. I would like to include a function within the package that produces/runs/views the index.qmd. I've created a github repository with the code.
The operative function as currently written is :
viewArticle <- function(){
quarto::quarto_run(input = system.file("article", "index.qmd", package = "helloQuarto"))
}
Here are the commands for starting with a clean project on my local machine:
remove.packages("helloQuarto")
pak::pkg_install("robwiederstein/helloQuarto")
library(helloQuarto)
search() #check path
helloQuarto::viewArticle()
Upon running the above commands, I receive the following error:
ERROR: The specified directory ('.') is not a Quarto project
Error in `processx::run(quarto_bin, args, echo = TRUE)`:
! System command 'quarto' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Type .Last.error to see the more details.
<system_command_status_error/rlib_error_3_0/rlib_error/error>
Error in `processx::run(quarto_bin, args, echo = TRUE)`:
! System command 'quarto' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
1. helloQuarto::viewArticle()
2. quarto::quarto_run(input = system.file("article", "index.qmd", …
3. quarto::quarto_render(input)
4. processx::run(quarto_bin, args, echo = TRUE)
5. processx:::throw(new_process_error(res, call = sys.call(), echo = echo, …
Session info is as follows:
R version 4.1.3 (2022-03-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.5.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] helloQuarto_0.1.0
Helpful resources include ?knitr::knit() @ note on paths and Quarto projects page.
Any help would be greatly appreciated.
--Rob