Skip to content

Commit dafc34f

Browse files
committed
lintr + error
1 parent dddcedb commit dafc34f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/rowwiseDT.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rowwiseDT = function(...) {
2121
first_problem_idx = which(is_problematic)[1L]
2222
col_idx = (first_problem_idx - 1L) %% ncols + 1L
2323
col_name = header[col_idx]
24-
obj_type = class(body[[first_problem_idx]])[1L]
24+
obj_type = class1(body[[first_problem_idx]])
2525
stopf(
2626
"In column '%s', received an object of type '%s'.\nComplex objects (like functions, formulas, or calls) must be wrapped in list() to be stored in a data.table column.\nPlease use `list(...)` for this value.",
2727
col_name,

inst/tests/tests.Rraw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21663,8 +21663,8 @@ test(2340.2, rowwiseDT(x =, func =,
2166321663
2, list(function(z) z * 2)),
2166421664
data.table(x = c(1, 2), func = list(\(x) x + 1, function(z) z * 2)))
2166521665
test(2340.3, rowwiseDT(x =, func =, 1, \(x) x + 1),
21666-
error = "In column 'func', received an object of type 'closure'.*wrap.*list")
21666+
error = "In column 'func', received an object of type 'function'.*wrap.*list")
2166721667
test(2340.4, rowwiseDT(x =, expr =, 1, quote(a + b)),
21668-
error = "In column 'expr', received an object of type 'language'.*wrap.*list")
21668+
error = "In column 'expr', received an object of type 'call'.*wrap.*list")
2166921669
test(2340.5, rowwiseDT(x =, plist =, 1, as.pairlist(list(123))),
2167021670
error = "In column 'plist', received an object of type 'pairlist'.*wrap.*list")

0 commit comments

Comments
 (0)