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

> ### Name: mm
> ### Title: All-in-one wrapper for the conversion between (R) Markdown,
> ###   FreeMind mind map, R code, directory structure, and HTML widget.
> ### Aliases: mm
> 
> ### ** Examples
> 
> # Example 1: From Markdown to other outputs ####
> 
> ## Source document ####
> input <- system.file("examples/mindr-md.Rmd", package = "mindr")
> 
> ## file.show(input) # Open the input file with the default program, if any
> input_txt <- readLines(input, encoding = "UTF-8")
> 
> ## Convert to mind map text, markdown outline, R script, and HTML widget ####
> mm_output <- mm(input_txt, output_type = c("mindmap", "markdown", "R", "widget"))
> mm_output
$mindmap
 [1] "<map version=\"1.0.1\">"                              
 [2] "<node TEXT=\"NA\">"                                   
 [3] "<node TEXT=\"(PART) A\"></node>"                      
 [4] "<node TEXT=\"Chapter 1\" LINK=\"https://pzhao.org \">"
 [5] "<node TEXT=\"Section 1.1 \"></node>"                  
 [6] "<node TEXT=\"Section 1.2 \"></node></node>"           
 [7] "<node TEXT=\"Chapter 2\">"                            
 [8] "<node TEXT=\"Section 2.1\"></node>"                   
 [9] "<node TEXT=\"Section 2.2 \"></node></node>"           
[10] "<node TEXT=\"(PART) B\"></node>"                      
[11] "<node TEXT=\"Chapter 3\"></node>"                     
[12] "<node TEXT=\"(APPENDIX) Appendix \"></node>"          
[13] "<node TEXT=\"a\"></node>"                             
[14] ""                                                     
[15] "</node></map>"                                        

$markdown
 [1] "# (PART) A"                        "# [Chapter 1](https://pzhao.org) "
 [3] "## Section 1.1 "                   "## Section 1.2 "                  
 [5] "# Chapter 2"                       "## Section 2.1"                   
 [7] "## Section 2.2 "                   "# (PART) B"                       
 [9] "# Chapter 3"                       "# (APPENDIX) Appendix "           
[11] "# a"                               "# b"                              

$r
 [1] "#= # (PART) A --------"                              
 [2] ""                                                    
 [3] "#= # [Chapter 1](https://pzhao.org) {#cha1} --------"
 [4] ""                                                    
 [5] "#= ## Section 1.1 {#sec1.1} --------"                
 [6] ""                                                    
 [7] "#' $$f(k) = {n \\choose k} p^{k} (1-p)^{n-k}$$"      
 [8] ""                                                    
 [9] "#= ## Section 1.2 {#sec1.2} --------"                
[10] ""                                                    
[11] "#' $$\\begin{array}{ccc}"                            
[12] "#' x_{11} & x_{12} & x_{13}\\\\"                     
[13] "#' x_{21} & x_{22} & x_{23}"                         
[14] "#' \\end{array}$$"                                   
[15] ""                                                    
[16] "#= # Chapter 2 --------"                             
[17] ""                                                    
[18] "#= ## Section 2.1 --------"                          
[19] ""                                                    
[20] "#' - Item 1"                                         
[21] "#' - Item 2"                                         
[22] "#'   + Item 2.1"                                     
[23] "#'   * Item 2.2"                                     
[24] "#'   "                                               
[25] "#= ## Section 2.2  --------"                         
[26] ""                                                    
[27] "#= # (PART) B --------"                              
[28] ""                                                    
[29] "#= # Chapter 3 --------"                             
[30] ""                                                    
[31] "#= # (APPENDIX) Appendix {-} --------"               
[32] ""                                                    
[33] "#= # a --------"                                     
[34] ""                                                    
[35] "#= # b --------"                                     

$widget

> 
> ## Save the output texts as files ####
> 
> ### mind map ####
> output <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".mm")
> writeLines(mm_output$mindmap, output, useBytes = TRUE)
> # file.show(output) # Open the output file with the default program, if any
> message("Input:  ", input, "\nOutput: ", output)
Input:  /Volumes/Builds/packages/high-sierra-x86_64/results/4.1/mindr.Rcheck/mindr/examples/mindr-md.Rmd
Output: /Volumes/Temp/tmp/Rtmpa4mFGi/file65b47136c9bc.mm
> # file.remove(output) # remove the output file
> 
> ### markdown outline ####
> output <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".md")
> writeLines(mm_output$markdown, output, useBytes = TRUE)
> # file.show(output) # Open the output file with the default program, if any
> message("Input:  ", input, "\nOutput: ", output)
Input:  /Volumes/Builds/packages/high-sierra-x86_64/results/4.1/mindr.Rcheck/mindr/examples/mindr-md.Rmd
Output: /Volumes/Temp/tmp/Rtmpa4mFGi/file65b443f68fb5.md
> # file.remove(output) # remove the output file
> 
> ### R script ####
> output <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".R")
> writeLines(mm_output$r, output, useBytes = TRUE)
> # file.show(output) # Open the output file with the default program, if any
> message("Input:  ", input, "\nOutput: ", output)
Input:  /Volumes/Builds/packages/high-sierra-x86_64/results/4.1/mindr.Rcheck/mindr/examples/mindr-md.Rmd
Output: /Volumes/Temp/tmp/Rtmpa4mFGi/file65b47054d6ee.R
> # file.remove(output) # remove the output file
> 
> ### Widget ####
> output <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".html")
> htmlwidgets::saveWidget(mm_output$widget, file = output)
Error in htmlwidgets::saveWidget(mm_output$widget, file = output) : 
  Saving a widget with selfcontained = TRUE requires pandoc. For details see:
https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md
Execution halted