diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2019-07-15 14:45:52 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-07-15 14:45:52 +0200 |
commit | c8bfe56bd627e1945815631ce5c2ac27333fa246 (patch) | |
tree | 666ed7e5d1dc9e3e6c7e64138937a8e0aa641a6e /R | |
parent | 1cc812d69311a1b3f846d0fb160a68a26fe11d65 (diff) |
Add chent$emf() function based on devEMF
Diffstat (limited to 'R')
-rw-r--r-- | R/chent.R | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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() } ) ) |