I have an R Markdown file that I repurpose to analyze new samples. Sometimes the analysis generates no significant results, and so when I try to plot the result an error is thrown. I simply want to continue to Knit the PDF if such an error occurs.
I've tried {r error = TRUE}, but the knitting still halts for some reason. Is there another knitr option that would bypass the error?
{r Gene Ontology Enrichment, include = FALSE, error = TRUE}
enrichplot::barplot(ego.MF,
font.size = 8,
title="GO Enrichment - Molecular Function",
showCategory=20)
Quitting from lines 441-478 (file.Rmd)
Error in ans[ypos] <- rep(yes, length.out = len)[ypos] :
replacement has length zero