From 950a406ae2c0c8d163269c06c398c126e963ae8f Mon Sep 17 00:00:00 2001
From: tomwenseleers <Tom.wenseleers@bio.kuleuven.be>
Date: Mon, 19 Nov 2018 13:46:32 +0100
Subject: [PATCH] Small bug fixing

---
 .Rbuildignore    | 2 ++
 R/graph2bitmap.R | 2 +-
 R/graph2office.R | 2 +-
 R/graph2vector.R | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.Rbuildignore b/.Rbuildignore
index a9af827..f017b00 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -5,3 +5,5 @@ cran-comments.md
 ^.git$
 ^export.Rproj$
 ^.*\.Rproj$
+.Rhistory
+.RData
\ No newline at end of file
diff --git a/R/graph2bitmap.R b/R/graph2bitmap.R
index 227d035..a6a9d2a 100644
--- a/R/graph2bitmap.R
+++ b/R/graph2bitmap.R
@@ -63,7 +63,7 @@ graph2bitmap = function(x = NULL, file = "Rplot", fun = NULL, type = c("PNG","JP
     stop("base R plots cannot be passed as objects, use ggplot2 or lattice plots instead")
   myplot = if (is.null(fun)) function(pl = p) print(pl) else fun
   
-  if(options()$device){
+  if(options()$device == FALSE){
     plotsize = dev.size()
   } else {
     plotsize = c(7,5) # default device size: 10 inch x 10 inch
diff --git a/R/graph2office.R b/R/graph2office.R
index fc52090..7de4637 100644
--- a/R/graph2office.R
+++ b/R/graph2office.R
@@ -96,7 +96,7 @@ graph2office = function(x = NULL, file = "Rplot", fun = NULL, type = c("PPT","DO
   } 
   
   ### 2. Prepare the plotting region and the plot apsect
-  if(options()$device){
+  if(options()$device == FALSE){
     plotsize = dev.size()
   } else {
     plotsize = c(7,5) # default device size: 10 inch x 10 inch
diff --git a/R/graph2vector.R b/R/graph2vector.R
index 38ce21c..7e0d7ff 100644
--- a/R/graph2vector.R
+++ b/R/graph2vector.R
@@ -68,7 +68,7 @@ graph2vector = function(x = NULL, file = "Rplot", fun = NULL, type = "SVG",
     stop("base R plots cannot be passed as objects, use ggplot2 or lattice plots instead")
   myplot = if (is.null(fun)) function(pl = p) print(pl) else fun
   
-  if(options()$device){
+  if(options()$device == FALSE){
     plotsize = dev.size()
   } else {
     plotsize = c(7,5) # default device size: 10 inch x 10 inch