Skip to content

Commit 27887d4

Browse files
Disable Rplots.pdf generation in BuildPlots.R
1 parent 30b269c commit 27887d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BenchmarkDotNet/Templates/BuildPlots.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BenchmarkDotNetVersion <- "$BenchmarkDotNetVersion$ "
22
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE, showWarnings = FALSE)
3-
list.of.packages <- c("ggplot2", "dplyr", "gdata", "tidyr", "grid", "gridExtra", "Rcpp")
3+
list.of.packages <- c("ggplot2", "dplyr", "gdata", "tidyr", "grid", "gridExtra", "Rcpp", "R.devices")
44
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
55
if(length(new.packages)) install.packages(new.packages, lib = Sys.getenv("R_LIBS_USER"), repos = "https://cran.rstudio.com/")
66
library(ggplot2)
@@ -9,6 +9,7 @@ library(gdata)
99
library(tidyr)
1010
library(grid)
1111
library(gridExtra)
12+
library(R.devices)
1213

1314
isEmpty <- function(val){
1415
is.null(val) | val == ""
@@ -38,7 +39,8 @@ nicePlot <- function(p) grid.arrange(p, bottom = BenchmarkDotNetVersionGrob)
3839
printNice <- function(p) {} # print(nicePlot(p))
3940
ggsaveNice <- function(fileName, p, ...) {
4041
cat(paste0("*** Plot: ", fileName, " ***\n"))
41-
ggsave(fileName, plot = nicePlot(p), ...)
42+
# See https://stackoverflow.com/a/51655831/184842
43+
suppressGraphics(ggsave(fileName, plot = nicePlot(p), ...))
4244
cat("------------------------------\n")
4345
}
4446

0 commit comments

Comments
 (0)