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,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
res <- list(input = as.list(environment()),
......
......@@ -100,9 +100,7 @@ biAxisDiamondPlot <- function(dat, items = NULL,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
if (length(leftAnchors) != length(rightAnchors)) {
......
......@@ -82,9 +82,7 @@ diamondPlot <- function(data,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
### In case we want to check for a complete dataframe
......
......@@ -25,9 +25,7 @@ duoComparisonDiamondPlot <- function(dat, items = NULL,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
if (length(unique(stats::na.omit(dat[, compareBy]))) != 2) {
......
......@@ -81,12 +81,12 @@ ggSave <- function(file=NULL, plot = ggplot2::last_plot(),
if (device[i] == 'jpg') {
device[i] <- 'jpeg';
if (is.null(type[i])) {
if (is.null(type[i]) && length(capabilities("cairo") > 0) && capabilities("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";
}
......
......@@ -86,9 +86,7 @@ meanSDtoDiamondPlot <- function(dat = NULL,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
varNamesToUse <- c(means, sds, ns);
......
......@@ -129,9 +129,7 @@ meansComparisonDiamondPlot <- function(dat, items = NULL,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
...) {
res <- list();
......
......@@ -95,9 +95,7 @@ meansDiamondPlot <- function(data, items = NULL, labels = NULL,
outputFile = NULL,
outputWidth = 10,
outputHeight = 10,
ggsaveParams = list(units='cm',
dpi=300,
type="cairo"),
ggsaveParams = ufs::opts$get("ggsaveParams"),
dat=NULL,
...) {
......
......@@ -206,6 +206,13 @@ opts$defaults <-
ggBaseSize = 11,
ggsaveParams = list(units='cm',
dpi=300,
type=ifelse(
length(capabilities("cairo") > 0) && capabilities("cairo"),
"cairo",
NULL)),
### Default heading level, for convenience
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