Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit 59ef053

Browse files
committed
Update hisub.R
1 parent f7905be commit 59ef053

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hisub.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,10 @@ args_pairs2 <- c()
657657
for (i in seq_along(args_pairs)) {
658658
if (args_pairs[[i]][1] == "data") {
659659
if (data_idx == 1) {
660-
dat_label <- 'if (exists("data")) data else ""'
660+
dat_label <- 'if (exists("data") && is.data.frame(data)) data else ""'
661661
} else {
662662
dat_label <- paste0("data", data_idx)
663-
dat_label <- sprintf('if (exists("%s")) %s else ""', dat_label, dat_label)
663+
dat_label <- sprintf('if (exists("%s") && is.data.frame(%s)) %s else ""', dat_label, dat_label, dat_label)
664664
}
665665
z <- paste(args_pairs[[i]][2], "=", paste0(dat_label, ","))
666666

0 commit comments

Comments
 (0)