From 0f772b2a2e26acb2ab02673ef92bf7bb037868ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Todor=20Kondi=C4=87?= <kontrapunkt@uclmail.net> Date: Wed, 8 Mar 2023 14:21:50 +0100 Subject: [PATCH] norm_path: Stop it from complaining about non-existing paths when path = "". --- R/base.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/base.R b/R/base.R index 320d6b6..11bef74 100644 --- a/R/base.R +++ b/R/base.R @@ -18,7 +18,13 @@ the_ifelse <- data.table::fifelse dtable <- data.table::data.table -norm_path <- function(...) normalizePath(...,winslash='/') +norm_path <- function(...) { + test = nchar(...) > 0L + res = character(length(test)) + res[test] = normalizePath(...[test],winslash='/') + res[!test] = ...[!test] + res +} tab2file<-function(tab,file,...) { data.table::fwrite(x=tab,file=file,...) -- GitLab