Commit 3a3477be authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters
Browse files

added check whether cairo capabilities exist

parent 779e296a
Pipeline #238116561 failed with stage
in 5 minutes and 52 seconds
...@@ -105,9 +105,7 @@ associationsDiamondPlot <- function(dat, covariates, criteria, ...@@ -105,9 +105,7 @@ associationsDiamondPlot <- function(dat, covariates, criteria,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
res <- list(input = as.list(environment()), res <- list(input = as.list(environment()),
......
...@@ -100,9 +100,7 @@ biAxisDiamondPlot <- function(dat, items = NULL, ...@@ -100,9 +100,7 @@ biAxisDiamondPlot <- function(dat, items = NULL,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
if (length(leftAnchors) != length(rightAnchors)) { if (length(leftAnchors) != length(rightAnchors)) {
......
...@@ -82,9 +82,7 @@ diamondPlot <- function(data, ...@@ -82,9 +82,7 @@ diamondPlot <- function(data,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
### In case we want to check for a complete dataframe ### In case we want to check for a complete dataframe
......
...@@ -25,9 +25,7 @@ duoComparisonDiamondPlot <- function(dat, items = NULL, ...@@ -25,9 +25,7 @@ duoComparisonDiamondPlot <- function(dat, items = NULL,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
if (length(unique(stats::na.omit(dat[, compareBy]))) != 2) { if (length(unique(stats::na.omit(dat[, compareBy]))) != 2) {
......
...@@ -81,12 +81,12 @@ ggSave <- function(file=NULL, plot = ggplot2::last_plot(), ...@@ -81,12 +81,12 @@ ggSave <- function(file=NULL, plot = ggplot2::last_plot(),
if (device[i] == 'jpg') { if (device[i] == 'jpg') {
device[i] <- 'jpeg'; device[i] <- 'jpeg';
if (is.null(type[i])) { if (is.null(type[i]) && length(capabilities("cairo") > 0) && capabilities("cairo")) {
type[i] <- "cairo"; type[i] <- "cairo";
} }
} }
if ((is.null(type[i])) && (device[i]=="png")) { if ((is.null(type[i])) && (device[i]=="png") && length(capabilities("cairo") > 0) && capabilities("cairo")) {
type[i] <- "cairo-png"; type[i] <- "cairo-png";
} }
......
...@@ -86,9 +86,7 @@ meanSDtoDiamondPlot <- function(dat = NULL, ...@@ -86,9 +86,7 @@ meanSDtoDiamondPlot <- function(dat = NULL,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
varNamesToUse <- c(means, sds, ns); varNamesToUse <- c(means, sds, ns);
......
...@@ -129,9 +129,7 @@ meansComparisonDiamondPlot <- function(dat, items = NULL, ...@@ -129,9 +129,7 @@ meansComparisonDiamondPlot <- function(dat, items = NULL,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
...) { ...) {
res <- list(); res <- list();
......
...@@ -95,9 +95,7 @@ meansDiamondPlot <- function(data, items = NULL, labels = NULL, ...@@ -95,9 +95,7 @@ meansDiamondPlot <- function(data, items = NULL, labels = NULL,
outputFile = NULL, outputFile = NULL,
outputWidth = 10, outputWidth = 10,
outputHeight = 10, outputHeight = 10,
ggsaveParams = list(units='cm', ggsaveParams = ufs::opts$get("ggsaveParams"),
dpi=300,
type="cairo"),
dat=NULL, dat=NULL,
...) { ...) {
......
...@@ -206,6 +206,13 @@ opts$defaults <- ...@@ -206,6 +206,13 @@ opts$defaults <-
ggBaseSize = 11, ggBaseSize = 11,
ggsaveParams = list(units='cm',
dpi=300,
type=ifelse(
length(capabilities("cairo") > 0) && capabilities("cairo"),
"cairo",
NULL)),
### Default heading level, for convenience ### Default heading level, for convenience
defaultHeadingLevel = 3, defaultHeadingLevel = 3,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment