Running examples in 'knitrdata-Ex.R' failed
The error most likely occurred in:

> ### Name: create_chunk
> ### Title: Tools for creating (data) chunks and inserting them into
> ###   Rmarkdown documents
> ### Aliases: create_chunk insert_chunk
> 
> ### ** Examples
> 
> # Use a temporary directory ----------------------------
> owd = getwd()
> td = tempdir()
> setwd(td)
> 
> # Test --------------
> library(knitrdata)
> library(magrittr) # For pipe operator
> 
> # Create new Rmarkdown document
> if (file.exists("test.create_chunks.Rmd"))
+   file.remove("test.create_chunks.Rmd")
> rmarkdown::draft("test.create_chunks.Rmd","github_document","rmarkdown",
+                  edit=FALSE)
> 
> # List all chunks in document
> chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
> chunklst
  type    label start end
1    r    setup     6   8
2    r     cars    18  20
3    r pressure    26  28
> 
> # Remove the pressure chunk
> xx = split_rmd_by_chunk(file="test.create_chunks.Rmd",chunk_label="pressure")
> txt = c(xx$pre_chunk,xx$post_chunk)
> writeLines(txt,"test.create_chunks.Rmd")
> 
> # List chunks again
> chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
> chunklst
  type label start end
1    r setup     6   8
2    r  cars    18  20
> 
> # Remove all but setup chunk
> remove_chunks(file="test.create_chunks.Rmd",
+               chunk_labels = 2:nrow(chunklst),
+               output.file="test.create_chunks.Rmd")
> 
> # List all chunks again
> chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
> chunklst
  type label start end
1    r setup     6   8
> 
> # Create some binary data
> x = data.frame(a=1:10,b=(1:10)^2)
> saveRDS(x,"test.create_chunks.RDS")
> 
> # Push chunks into Rmarkdown document
> # Insert in reverse order to not have to figure out line number
> txt = create_chunk(chunk_label="plot",c("x","plot(b~a,data=x)"),chunk_type="r") %>%
+   insert_chunk(11,rmd.file="test.create_chunks.Rmd")
> txt = data_encode("test.create_chunks.RDS","base64") %>%
+   create_chunk(chunk_label="thedata",output.var="x",format="binary",loader.function=readRDS) %>%
+   insert_chunk(11,txt)
> txt = create_chunk(chunk_label="loadknitrdata","library(knitrdata)",chunk_type="r") %>%
+   insert_chunk(11,txt)
> 
> writeLines(txt,"test.create_chunks.Rmd")
> 
> # List all chunks again
> chunklst = list_rmd_chunks(file="test.create_chunks.Rmd")
> chunklst
  type         label start end
1    r         setup     6   8
2    r loadknitrdata    11  13
3 data       thedata    14  20
4    r          plot    21  24
> 
> # Render document to test
> if (rmarkdown::pandoc_available(version="1.12.3"))
+   rmarkdown::render("test.create_chunks.Rmd")


processing file: test.create_chunks.Rmd
output file: test.create_chunks.knit.md

"D:/compiler/pandoc/pandoc" +RTS -K512m -RTS test.create_chunks.knit.md --to markdown_github-yaml_metadata_block --from markdown+autolink_bare_uris+tex_math_single_backslash --output test.create_chunks.md --atx-headers --template "D:\temp\RtmpGIBv0f\RLIBS_14bc053d4edb\rmarkdown\rmarkdown\templates\github_document\resources\default.md" 
Error in output_format$post_processor(front_matter, input, output_file,  : 
  object 'preview_math' not found
Calls: <Anonymous> -> <Anonymous>
Execution halted