Skip to content

Commit 54a14cc

Browse files
committed
support push (back or front) on empty data.frame
1 parent 8bd3754 commit 54a14cc

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2022-10-04 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/include/Rcpp/DataFrame.h (set_type_after_push): Allow zero-row
4+
data.frame objects to be grown by push_{back,front}()
5+
16
2022-09-25 Dirk Eddelbuettel <[email protected]>
27

38
* DESCRIPTION (Version, Date): Roll minor version

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 1.0.9.3
4-
Date: 2022-09-25
3+
Version: 1.0.9.3.1
4+
Date: 2022-10-04
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
66
Nathan Russell, Inaki Ucar, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/include/Rcpp/DataFrame.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ namespace Rcpp{
140140
max_rows = Rf_xlength(*it);
141141
}
142142
}
143-
for (it = Parent::begin(); it != Parent::end(); ++it) {
144-
if (Rf_xlength(*it) == 0 || ( Rf_xlength(*it) > 1 && max_rows % Rf_xlength(*it) != 0 )) {
145-
// We have a column that is not an integer fraction of the largest
146-
invalid_column_size = true;
143+
if (max_rows > 0) {
144+
for (it = Parent::begin(); it != Parent::end(); ++it) {
145+
if (Rf_xlength(*it) == 0 || ( Rf_xlength(*it) > 1 && max_rows % Rf_xlength(*it) != 0 )) {
146+
// We have a column that is not an integer fraction of the largest
147+
invalid_column_size = true;
148+
}
147149
}
148150
}
149151
if (invalid_column_size) {

0 commit comments

Comments
 (0)