Skip to content

Commit 8a81926

Browse files
committed
dogroups: resize missing groups to one row
1 parent 654247a commit 8a81926

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/dogroups.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
217217
}
218218
if (istarts[i] == NA_INTEGER || (LENGTH(order) && iorder[ istarts[i]-1 ]==NA_INTEGER)) {
219219
for (int j=0; j<length(SDall); ++j) {
220+
SETLENGTH(VECTOR_ELT(SDall, j), 1);
220221
writeNA(VECTOR_ELT(SDall, j), 0, 1, false);
221222
// writeNA uses SET_ for STR and VEC, and we always use SET_ to assign to SDall always too. Otherwise,
222223
// this writeNA could decrement the reference for the old value which wasn't incremented in the first place.

0 commit comments

Comments
 (0)