From 796f5b09fc22f284a3393fe2cb0cacdb52b9e5aa Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Wed, 24 Jan 2024 00:00:16 +0000 Subject: [PATCH] fix archive() --- R/archive.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/archive.R b/R/archive.R index b5ffb930..18de462b 100644 --- a/R/archive.R +++ b/R/archive.R @@ -94,8 +94,10 @@ archive <- function(..., object, file) { readArchive(file = ..1) } else if (dlen == 3L) { - if (dots[[2L]] == "") { - dots[[3L]] == "" && { + d <- dots[[2L]] + if (missing(d)) { + d <- dots[[3L]] + missing(d) && { interactive() || stop("Empty arguments for both 'object' and 'file' passed to archive()\nFor read operations specify 'file' only, write operations both 'object' and 'file'", call. = FALSE) return(.deconstruct(...))