Potential Bug in rmarkdown source code

I'm using rmarkdown installed from github for creating a bookdown document.
I keep getting this error when cleaning or trying to render a site,

Error in xfun::existing_files(file.path(root, xfun::with_ext("index", :
unused argument (error = FALSE)

This is because xfun::existing_files function doesn't take an 'error' argument. This is on line 275 of render_site.R in the rmarkdown source code.

Due to my environment being a mess, it's hard for me to confirm if this is a bug on my end (I have many packages with many versions of R). Is this an issue on my end or is this a bug in the github code?

github: rmarkdown/render_site.R at main · rstudio/rmarkdown · GitHub

Does this happen when creating a new project in RStudio in a new directory as a bookdown and does the Index.Rmd minimal example not render to pdf? Or is it something else? (And, BTW, there's not Quarto Book which has about as many knobs, switches, buttons and pulleys for text layout as ggplot has for charts.)

Thank you for the response!

In regards to quarto, we really like the formatting of bookdown. Is there a quarto book example with the same html formatting as bookdown? After testing quarto, it seemed like something we will switch to in the future.

I was able to recreate the error.

  1. I created a new bookdown project with default project.
  2. Then ran remotes::install_github(c('rstudio/rmarkdown', 'rstudio/bookdown')) to fix the appendix bug.
  3. Get error when running each of the three rmarkdown types.
> version
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
major          4                           
minor          1.2                         
year           2021                        
month          11                          
day            01                          
svn rev        81115                       
language       R                           
version.string R version 4.1.2 (2021-11-01)
nickname       Bird Hippie      

p.s. This is low priority as we just wanted the appendix and page breaks to work.

Additional note, I was able to fix that bug by forking rmarkdown and applying the fix.

Then I ran into another issue. Because I have a large book, I wanted to add page breaks within certain chapters. So I tried using the split_by: rmd method. It ran without error but not all chapters got rendered.

For now, I'm giving up on this. Hopefully it'll be fixed when we update to the current versions of R, etc.

Hard to find a better example than R Workflow by the legendary Frank Harrell, author of the {Hmisc} package. Its source code is available. For printed format, output to pdf through TeX offers all the power and headaches of that environment by mixing markdown and LaTeX.

Which version of xfun do you have ?

error argument has been added in version 0.30

  • Added a new argument error = TRUE to existing_files().

source: xfun/NEWS.md at main · yihui/xfun · GitHub

Installing rmarkdown should have ask to upgrade xfun as we have a min requirement of 0.30

See imports in CRAN page : CRAN - Package rmarkdown

So somehow, you are running a rmarkdown version that require xfun 0.30 but does not seem like you have it...

Can you share you packages version ?

This should work to get one html file in output per Rmd file in input but you would need to clean your current book output to start fresh when changing this option

Please do share your issue, and check that you are up to date on all packages version. You can always ask here or open issues in Bookdown if you found some. Thank you

Thank you, I think you're right. I was running it with xfun v0.29. I only updated rmarkdown using a github install, because I needed to keep R-4.1.2, but wanted the most recent rmarkdown (I updated pandoc which caused the rmarkdown package for pandoc to have some bugs which are fixed in the newest version).

So for now, I'm good. I won't try to change anything until we're ready to update to the newest version of R.

Thank you for all of the help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.