You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current behaviour is always to return a character for docnames() and featnames(). This is built into how dimnames() works for fcm and dfm objects. But this is not the default behaviour for base::matrix objects, which return NULL for empty dimnames, and as of Matrix v1.5.5, the base behaviour will be enforced for all Matrix class objects. (see #2258)
Keeping the current behaviour, which was fixed in Fix v3 matrix 1.5.5 #2267 and Fix v4 matrix 1.5.5 #2273, and always return character() for all -- including empty --empty docnames() and featnames(), and for dimnames() on these objects.
Keeping the current behaviour for docnames() and featnames() as per (1), but changing dimnames() to return NULL when that function is called.
Changing docnames(), featnames(), and dimnames() to return NULL when a dimension is empty. If we choose (3), then we would need to change the docnames() behaviour for all other objects for which docnames() methods are defined.
I would favour (2), and strongly consider (3), but this would need some tests.
The text was updated successfully, but these errors were encountered:
kbenoit
changed the title
Consider making empty dimnames NULL for dfm and fcm
Consider returning NULL for empty dimnames for dfm and fcm
May 11, 2023
Our current behaviour is always to return a
character
fordocnames()
andfeatnames()
. This is built into howdimnames()
works forfcm
anddfm
objects. But this is not the default behaviour forbase::matrix
objects, which returnNULL
for empty dimnames, and as of Matrix v1.5.5, the base behaviour will be enforced for all Matrix class objects. (see #2258)Created on 2023-05-11 with reprex v2.0.2
Our options are be one of:
character()
for all -- including empty --emptydocnames()
andfeatnames()
, and fordimnames()
on these objects.docnames()
andfeatnames()
as per (1), but changingdimnames()
to returnNULL
when that function is called.docnames()
,featnames()
, anddimnames()
to returnNULL
when a dimension is empty. If we choose (3), then we would need to change thedocnames()
behaviour for all other objects for which docnames() methods are defined.I would favour (2), and strongly consider (3), but this would need some tests.
The text was updated successfully, but these errors were encountered: