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 | |
parent | 1cc812d69311a1b3f846d0fb160a68a26fe11d65 (diff) |
Add chent$emf() function based on devEMF
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | DESCRIPTION | 7 | ||||
-rw-r--r-- | R/chent.R | 15 |
3 files changed, 25 insertions, 3 deletions
@@ -1,3 +1,9 @@ +commit 1cc812d69311a1b3f846d0fb160a68a26fe11d65 +Author: Johannes Ranke <jranke@uni-bremen.de> +Date: 2019-03-20 15:58:34 +0100 + + Use shQuote for filename creation in chent$pdf() + commit fe9c6bf06cb89ced0f61015bb24a88990a2c8fe8 Author: Johannes Ranke <jranke@uni-bremen.de> Date: 2019-02-21 16:00:30 +0100 diff --git a/DESCRIPTION b/DESCRIPTION index 123c12f..a94f482 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: chents Type: Package Title: Chemical Entities as R Objects -Version: 0.2-7 -Date: 2019-03-20 +Version: 0.2-8 +Date: 2019-07-13 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de")) Description: Utilities for dealing with chemical entities and associated @@ -21,7 +21,8 @@ Suggests: knitr, testthat, PythonInR, - covr + covr, + devEMF License: GPL LazyLoad: yes LazyData: yes @@ -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() } ) ) |