Skip to content

Commit 6c3fa53

Browse files
committed
Fix RecordArgs
1 parent a782329 commit 6c3fa53

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

R/General_RecordArgs.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#' @examples
6767
#' a <- 5
6868
#' b <- 3
69-
#'
69+
#'
7070
#' Function1 <- function(w = 5, x, y, z = 10) {
7171
#' Args <- IASDT.R::RecordArgs(call = match.call(), env = parent.frame())
7272
#' return(Args)
@@ -267,14 +267,21 @@ RecordArgs <- function(ExportPath = NULL, call = NULL, env = NULL) {
267267

268268
# Return the tibble or save it to a file based on ExportPath
269269
if (is.null(ExportPath)) {
270+
270271
# Return the tibble if no export path is provided
271272
return(result)
273+
272274
} else {
275+
276+
# Extract the calling function name without the namespace
277+
calling_func2 <- stringr::str_remove(calling_func, "^.+::")
278+
273279
# Save to .RData file if ExportPath is specified
274280
IASDT.R::SaveAs(
275-
InObj = result, OutObj = paste0("Args_", calling_func),
281+
InObj = result, OutObj = paste0("Args_", calling_func2),
276282
OutPath = ExportPath)
277283
# Return NULL invisibly after saving
278284
return(invisible(NULL))
285+
279286
}
280287
}

0 commit comments

Comments
 (0)