File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,33 @@ RecordArgs <- function(ExportPath = NULL) {
170170 # # ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| #
171171
172172 # Evaluate each argument in the parent environment, with fallback to global
173- # environment
173+ # environment, converting NULL defaults to scalar "NULL" for tibble
174+ # compatibility
175+
174176 evaluated_args <- lapply(combined_args , function (arg ) {
175177 tryCatch(
176178 # Try evaluating the argument in the grandparent environment
177- eval(arg , envir = parent_env ),
179+ {
180+ result <- eval(arg , envir = parent_env )
181+ if (is.null(result )) {
182+ # Convert NULL results (e.g., from default arguments) to scalar "NULL"
183+ " NULL"
184+ } else {
185+ result
186+ }
187+ },
178188 error = function (e ) {
179189 # If it fails, try the global environment as a fallback
180190 tryCatch(
181- eval(arg , envir = globalenv()),
191+ {
192+ result <- eval(arg , envir = globalenv())
193+ if (is.null(result )) {
194+ # Convert NULL results to scalar "NULL" in fallback case too
195+ " NULL"
196+ } else {
197+ result
198+ }
199+ },
182200 error = function (e2 ) {
183201 # Return NA if evaluation fails in both environments
184202 NA
You can’t perform that action at this time.
0 commit comments