Skip to content

Commit

Permalink
fix typo: should save to path2 instead of path (#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Aug 17, 2022
1 parent 83fb508 commit 9e36e9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.39.8
Version: 1.39.9
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Abhraneel", "Sarma", role = "ctb"),
Expand Down
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ plot2dev = function(plot, name, dev, device, path, width, height, options) {
print(plot)
# hack: if the device is gridSVG, save the plot to a temp path (with suffix ~)
path2 = if (dev == 'gridSVG') paste0(path, '~')
if (!is.null(path2)) do.call(gridSVG::grid.export, c(list(name = path), dargs))
if (!is.null(path2)) do.call(gridSVG::grid.export, c(list(name = path2), dargs))
dev.off()
# move the temp svg file to `path`
if (!is.null(path2)) file.rename(path2, path)
Expand Down

0 comments on commit 9e36e9c

Please sign in to comment.