-
Notifications
You must be signed in to change notification settings - Fork 997
Commit
* Remove {UN,}SET_S4_OBJECT usage * handle asS4 from R side * tweak NES * switch to C API * restore dogroups code using public API * new test * adjust NEWS * IS_S4_OBJECT --> isS4
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,7 +153,7 @@ 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)); | ||
IS_S4_OBJECT(dt) ? SET_S4_OBJECT(newdt) : UNSET_S4_OBJECT(newdt); // To support S4 objects that include data.table | ||
if (isS4(dt)) newdt = asS4(newdt, TRUE, 1); // To support S4 objects that include data.table | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ben-schwen
Member
|
||
//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 | ||
|
@ben-schwen I think #6257 is suggesting we need to
PROTECT()
theasS4()
output here, WDYT? I'm confused why we'd need to given wePROTECT()
thenewdt
for the first time a few lines prior...