aboutsummaryrefslogtreecommitdiff
path: root/pkg/R/TOXSWA_cwa.R
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/R/TOXSWA_cwa.R')
-rw-r--r--pkg/R/TOXSWA_cwa.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/R/TOXSWA_cwa.R b/pkg/R/TOXSWA_cwa.R
index a693dc1..d2720a9 100644
--- a/pkg/R/TOXSWA_cwa.R
+++ b/pkg/R/TOXSWA_cwa.R
@@ -187,6 +187,7 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
"integer", rep("numeric", 5)),
col.names = c("datetime", "t", "segment",
"xcd", "cwa_tot", "cwa", "Xss", "Xmp")))
+
if (is.null(zipfile)) close(file_connection) # only needed for files
if (!inherits(cwa_all_segments, "try-error")) {
@@ -219,9 +220,7 @@ TOXSWA_cwa <- R6Class("TOXSWA_cwa",
# out file from FOCUS TOXSWA 4 (TOXSWA 4.4.2 or similar)
outfile <- try(readLines(file_connection))
- if (is.null(zipfile)) {
- close(file_connection) # only needed for files
- }
+ close(file_connection) # only needed for files
if (inherits(outfile, "try-error")) {
stop("Could not read ", filename)

Contact - Imprint