Bookdown 0.22 -> 0.23 :: Error: $ operator is invalid for atomic vectors

Viewed 315

Would anyone come across this error in rendering when upgrading from 0.22 to 0.23? It renders perfectly in 0.23 and no issues whatsoever in all the .Rmd. Looking for any cue so I can solve the problem. Linux Ubuntu R4.1.1 all packages up to date.

==> rmarkdown::render_site(encoding = 'UTF-8')

Error: $ operator is invalid for atomic vectors Execution halted Error in Rscript_render(f, render_args, render_meta, add1, add2) : Failed to compile index.Rmd Calls: ... render_book -> render_new_session -> Rscript_render Execution halted

Exited with status 1.

3 Answers

UPDATE: see this answer by Yihui Xie.


I changed the contents in _output.yml from

bookdown::gitbook:
  config:
    search: yes

to

bookdown::gitbook:
  config:
    search:
      engine: fuse

and this fixed the issue. Other options of engine should also work as well as total removal of line search: yes.

I think, the problem was related to the changes in config that are described here.

Print-screen of section of interest

enter image description here

I have the same issue. R 4.1.1 on OSX 11.5. Updated R packages and I get the "Error: $ operator is invalid for atomic vectors" error even when rendering documents that do not contain any $ signs...

I was able to fix the issue by simply installing an older version of bookdown using:

library(devtools)
install_version("bookdown", version = "0.22", repos = "http://cran.us.r-project.org")

This is a bug of bookdown and has been fixed in the dev version, which you can install via

remotes::install_github('rstudio/bookdown')
Related