diff --git a/DESCRIPTION b/DESCRIPTION index cdcac2a..3310b72 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: evaluate Type: Package Title: Parsing and Evaluation Tools that Provide More Details than the Default -Version: 0.21.1 +Version: 0.21.2 Authors@R: c( person("Hadley", "Wickham", role = "aut"), person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), diff --git a/NEWS.md b/NEWS.md index e3fc5d8..31c75ab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Version 0.22 ================================================================================ +- Fixed a problem in the internal function `plot_calls()` that made the examples of `recordGraphics` fail to run on its help page (thanks, Kurt Hornik). Version 0.21 ================================================================================ diff --git a/R/graphics.R b/R/graphics.R index 5ba0843..c6a10cf 100644 --- a/R/graphics.R +++ b/R/graphics.R @@ -65,7 +65,8 @@ plot_calls <- function(plot) { # grid graphics do not have x[[1]]$name if (!is.null(nm <- x[[1]][["name"]])) return(nm) nm <- deparse(x[[1]]) - # the plot element should not be empty - if (length(x[[2]]) > 0 || !grepl("^requireNamespace\\(", nm)) nm + # the plot element should not be empty, and ignore calls that are simply + # requireNamespace() + if (length(x[[2]]) > 0 || !all(grepl("^requireNamespace\\(", nm))) nm })) }