Skip to content

Commit f108aa4

Browse files
committed
Keep the same default as before the PR and check if it is used before warning the user.
1 parent 1493152 commit f108aa4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

R/tm_data_table.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
#'
8787
tm_data_table <- function(label = "Data Table",
8888
variables_selected = list(),
89-
datasets_selected = "all",
90-
datanames = datasets_selected,
89+
datasets_selected = character(0),
90+
datanames = if (!length(datasets_selected)) "all" else datasets_selected,
9191
dt_args = list(),
9292
dt_options = list(
9393
searching = FALSE,
@@ -112,11 +112,12 @@ tm_data_table <- function(label = "Data Table",
112112
}
113113
})
114114
}
115-
if (!is.null(datasets_selected)) {
115+
if (!missing(datasets_selected)) {
116116
lifecycle::deprecate_soft(
117117
when = "0.4.0",
118-
what = "tm_data_table(datasets_selected",
119-
with = "tm_data_table(datanames)"
118+
what = "tm_data_table(datasets_selected)",
119+
with = "tm_data_table(datanames)",
120+
details = 'Use tm_data_table(datanames = "all") to keep the previous behavior and avoid this warning.',
120121
)
121122
}
122123
checkmate::assert_character(datanames, min.len = 0, min.chars = 1, null.ok = TRUE)

0 commit comments

Comments
 (0)