harrelfe / Hmisc

Harrell Miscellaneous
Other
208 stars 81 forks source link

[.pBlock() only retains the pBlock class if the result is a matrix #67

Closed lawremi closed 7 years ago

lawremi commented 7 years ago

I made a change to R where factor() uses order() instead of sort.list() when generating the levels. Thus, table(pBlock) ends up calling rank(), which does x[!nas] and [.pBlock yields an invalid object, since the result is a vector, not a matrix. That causes problems later.

This change makes it so [.pBlock just returns a vector when the result of the call to base [ is not a matrix.

harrelfe commented 7 years ago

Wonderful thanks for the fix - merged in now.