You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ rowwiseDT(
55
55
56
56
5.Querieslike`DT[, min(x):max(x)]`nowworkasexpected, i.e.thesameas`DT[, seq(min(x), max(x))]`or`with(DT, min(x):max(x))`, [#2069](https://github.com/Rdatatable/data.table/issues/2069). Shorthand like `DT[, a:b]` meaning "select from columns `a` through `b`" still works. Thanks to @franknarf1 for reporting and @jangorecki for the fix.
57
57
58
+
6.Fixedasegfaultin`fcase()`, [#6448](https://github.com/Rdatatable/data.table/issues/6448). Thanks @ethanbsmith for reporting with reprex, @aitap for finding the root cause, and @MichaelChirico for the PR.
59
+
58
60
## NOTES
59
61
60
62
1.TestsrunagainwhensomeSuggestspackagesaremissing, [#6411](https://github.com/Rdatatable/data.table/issues/6411). Thanks @aadler for the note and @MichaelChirico for the fix.
"Please make sure all output values have the same class."), i*2+2);
276
282
}
277
283
}
278
-
UNPROTECT(2); // class(value0), class(thens)
284
+
UNPROTECT(1); // class(thens)
279
285
}
280
-
if (!naout&&isFactor(value0)) {
281
-
if (!R_compute_identical(PROTECT(getAttrib(value0, R_LevelsSymbol)), PROTECT(getAttrib(thens, R_LevelsSymbol)), 0)) {
286
+
if (!naout&&ans_is_factor) {
287
+
if (!R_compute_identical(ans_levels, PROTECT(getAttrib(thens, R_LevelsSymbol)), 0)) {
282
288
if (idefault) {
283
289
error(_("Resulting value and 'default' are both type factor but their levels are different."));
284
290
} else {
285
291
error(_("Argument #2 and argument #%d are both factor but their levels are different."), i*2+2);
286
292
}
287
293
}
288
-
UNPROTECT(2); // levels(value0), levels(thens)
294
+
UNPROTECT(1); // levels(thens)
289
295
}
290
296
}
291
-
len1=xlength(thens);
292
-
if (len1!=len0&&len1!=1) {
297
+
n_this_arg=xlength(thens);
298
+
if (n_this_arg!=n_ans&&n_this_arg!=1) {
293
299
if (idefault) {
294
-
error(_("Length of 'default' must be 1 or %lld."), (long long)len0);
300
+
error(_("Length of 'default' must be 1 or %lld."), (long long)n_ans);
295
301
} else {
296
-
error(_("Length of output value #%d (%lld) must either be 1 or match the length of the logical condition (%lld)."), i*2+2, (long long)len1, (long long)len0);
302
+
error(_("Length of output value #%d (%lld) must either be 1 or match the length of the logical condition (%lld)."), i*2+2, (long long)n_this_arg, (long long)n_ans);
297
303
}
298
304
}
299
-
int64_tthenMask=len1>1 ? INT64_MAX : 0;
305
+
int64_tthenMask=n_this_arg>1 ? INT64_MAX : 0;
300
306
switch(TYPEOF(ans)) {
301
307
caseLGLSXP: {
302
308
constint*restrict pthens;
303
309
if (!naout) pthens=LOGICAL(thens); // the content is not useful if out is NA_LOGICAL scalar
0 commit comments