Skip to content

Commit

Permalink
for now revert dim(.) <- dim(.) *not* dropping dimnames [accidentally…
Browse files Browse the repository at this point in the history
… in 85380]

git-svn-id: https://svn.r-project.org/R/trunk@85444 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Oct 31, 2023
1 parent 16aaa40 commit 13f79d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,12 @@ SEXP dimgets(SEXP vec, SEXP val)
error(_("dims [product %lld] do not match the length of object [%lld]"),
(long long)total, (long long)len);
}
#if 0
// currently it is documented that `dim<-` removes dimnames() .. but ..
SEXP odim = getAttrib0(vec, R_DimSymbol); // keep dimnames(.) if dim() entries are unchanged
if((LENGTH(odim) != ndim) || memcmp((void *)INTEGER(odim),
(void *)INTEGER(val), ndim * sizeof(int)))
#endif
removeAttrib(vec, R_DimNamesSymbol);
installAttrib(vec, R_DimSymbol, val);

Expand Down

0 comments on commit 13f79d3

Please sign in to comment.