Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: collapse
Title: Advanced and Fast Data Transformation
Version: 2.0.17.9000
Date: 2024-11-19
Version: 2.0.18
Date: 2024-11-23
Authors@R: c(
person("Sebastian", "Krantz", role = c("aut", "cre"),
email = "[email protected]",
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# collapse 2.0.17.9000
# collapse 2.0.18

* Cases in `pivot(..., how = "longer")` with no `values` columns now no longer give an error. Thanks @alvarocombo for flagging this (#663).

* Fixed bug in `qF(c(4L, 1L, NA), sort = FALSE)`: hash function failure due to a coding bug. Thanks @mayer79 for flagging this (#666).

* If `x` is already a `qG` object of the right properties, calling `qG(x)` now does not copy `x` anymore. Thanks @mayer79 (https://github.com/mayer79/effectplots/issues/11).

# collapse 2.0.17

* In `GRP.default()`, the `"group.starts"` attribute is always returned, even if there is only one group or every observation is its own group. Thanks @JamesThompsonC (#631).
Expand Down
1 change: 1 addition & 0 deletions R/GRP.R
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ qG <- function(x, ordered = FALSE, na.exclude = TRUE, sort = .op[["sort"]],
ax <- if(return.groups) list(N.groups = attr(x, "N.groups"), groups = attr(x, "groups"), class = newclx) else
list(N.groups = attr(x, "N.groups"), class = newclx)
}
if(identical(ax, attributes(x))) return(x)
return(`attributes<-`(x, ax))
}
newclx <- c(if(ordered) "ordered", "qG", "na.included")
Expand Down
4 changes: 3 additions & 1 deletion src/data.table_subset.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ static SEXP shallow(SEXP dt, SEXP cols, R_len_t n)
SEXP newdt = PROTECT(allocVector(VECSXP, n)); protecti++; // to do, use growVector here?
SET_ATTRIB(newdt, shallow_duplicate(ATTRIB(dt)));
SET_OBJECT(newdt, OBJECT(dt));
if(IS_S4_OBJECT(dt)) newdt = asS4(newdt, TRUE, 1); // To support S4 objects that include data.table
if(IS_S4_OBJECT(dt)) {
newdt = PROTECT(asS4(newdt, TRUE, 1)); protecti++; // To support S4 objects that include data.table
}
//SHALLOW_DUPLICATE_ATTRIB(newdt, dt); // SHALLOW_DUPLICATE_ATTRIB would be a bit neater but is only available from R 3.3.0

// TO DO: keepattr() would be faster, but can't because shallow isn't merely a shallow copy. It
Expand Down
Loading