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
Within R/latex.s, format.df(x, ...) relies on detecting the type of its argument x to determine how to access its attributes. Here are the key lines from that method:
For these kinds of objects, xtype is set to 1 and so the code tries to read the dimension names with names() rather than dimnames()[[2]] as it should. This came up in real usage when Hmisc::latex() was mangling a matrix I gave it that was accidentally a list, and took a while to track down.
It seems to me that it would make more sense if the line instead looked like:
Within
R/latex.s
,format.df(x, ...)
relies on detecting the type of its argumentx
to determine how to access its attributes. Here are the key lines from that method:Hmisc/R/latex.s
Lines 140 to 144 in 6d9bd1f
The problem is that it's possible for a matrix to also be a list. For example:
For these kinds of objects,
xtype
is set to1
and so the code tries to read the dimension names withnames()
rather thandimnames()[[2]]
as it should. This came up in real usage whenHmisc::latex()
was mangling a matrix I gave it that was accidentally a list, and took a while to track down.It seems to me that it would make more sense if the line instead looked like:
The text was updated successfully, but these errors were encountered: