Running examples in ‘formatBibtex-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: format_bibtex_entry
> ### Title: Format BibTeX Entries in An Opinionated Way
> ### Aliases: format_bibtex_entry format_bibtex_file
> 
> ### ** Examples
> 
> library(formatBibtex)
> 
> ## example BibTeX file that needs formatting
> example_bib <- system.file("examples/example.bib", package = "formatBibtex")
> print(readLines(example_bib), quote = FALSE)
 [1] @article{andersen1982cox,                                                       
 [2]   title = {Cox's regression model for counting processes: a large sample study},
 [3]   author = {Andersen, Per Kragh and Gill, Richard D},                           
 [4]   journal = {the annals of statistics},                                         
 [5]   volume = {10},                                                                
 [6]   number = {4},                                                                 
 [7]   pages = {1100-1120},                                                          
 [8]   year = {1982},                                                                
 [9]   publisher = {JSTOR}                                                           
[10] }                                                                               
[11]                                                                                 
[12] @book{chen2012monte,                                                            
[13]   title={Monte Carlo methods in Bayesian computation},                          
[14]   author={Chen, Ming-Hui and Shao, Qi-Man and Ibrahim, Joseph G},               
[15]   year={2012},                                                                  
[16]   publisher={Springer Science \\& Business Media}                               
[17] }                                                                               
[18]                                                                                 
[19] @article{wu1983convergence,                                                     
[20]   title={On the convergence properties of the EM algorithm},                    
[21]   author={Wu, C.F. Jeff},                                                       
[22]   journal={The Annals of statistics},                                           
[23]   pages={95--103},                                                              
[24]   year={1983},                                                                  
[25]   publisher={JSTOR}                                                             
[26] }                                                                               
> 
> ## needs the package bibtex
> has_bibtex <- requireNamespace("bibtex", quietly = TRUE)
> 
> ## example of format_bibtex_entry()
> if (has_bibtex) {
+     bib <- bibtex::read.bib(example_bib)
+     ## check the default words that need protection by curly braces
+     (default_words <- getOption("formatBibtex.protected_words"))
+     format_bibtex_entry(bib, protected_words = c(default_words, "SMEM"))
+ }
Error in gsub(as.character(pattern), as.character(replacement), x, ignore.case,  : 
  NA in coercion to bool
Calls: format_bibtex_entry ... lapply -> FUN -> format_string -> do.call -> <Anonymous>
Execution halted