aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-07-15 14:45:52 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2019-07-15 14:45:52 +0200
commitc8bfe56bd627e1945815631ce5c2ac27333fa246 (patch)
tree666ed7e5d1dc9e3e6c7e64138937a8e0aa641a6e /R
parent1cc812d69311a1b3f846d0fb160a68a26fe11d65 (diff)
Add chent$emf() function based on devEMF
Diffstat (limited to 'R')
-rw-r--r--R/chent.R15
1 files changed, 15 insertions, 0 deletions
diff --git a/R/chent.R b/R/chent.R
index ae23aeb..f3626de 100644
--- a/R/chent.R
+++ b/R/chent.R
@@ -403,6 +403,21 @@ chent <- R6Class("chent",
png(path, antialias = antialias)
plot(self)
dev.off()
+ },
+ emf = function(file = paste0(self$identifier, ".emf"), dir = "structures/emf") {
+ if (!requireNamespace("devEMF")) {
+ stop("You need to have the devEMF package installed for this function")
+ }
+ if (!dir.exists(dir)) {
+ message("Directory '", dir, "' does not exist")
+ message("Trying to create directory '", dir, "'")
+ dir.create(dir, recursive = TRUE)
+ }
+ path = file.path(dir, file)
+ message("Creating file '", path, "'")
+ devEMF::emf(path)
+ plot(self)
+ dev.off()
}
)
)

Contact - Imprint