When rendering to latex, the caption for figure 17.1 fails to render because it contains unescaped underscores (in "facet_grid()" and "facet_wrap()"). A fix is to create the caption above the block and reference it in the figure, which causes it to be correctly escaped when rendering to either latex or HTML, as described in the "Text References" section of Authoring Books with R Markdown.
When rendering to latex, the caption for figure 17.1 fails to render because it contains unescaped underscores (in "
facet_grid()
" and "facet_wrap()
"). A fix is to create the caption above the block and reference it in the figure, which causes it to be correctly escaped when rendering to either latex or HTML, as described in the "Text References" section of Authoring Books with R Markdown.Also submitting a PR with this fix.