juliasilge / widyr

Widen, process, and re-tidy a dataset
http://juliasilge.github.io/widyr/
Other
327 stars 29 forks source link

pairwise_pmi_ using properties of logs for improved numerical precission #14

Closed twolodzko closed 2 years ago

twolodzko commented 6 years ago

This PR makes minor changes in pairwise_pmi_ to improve numerical precision. Unfortunately, for some reason pairwise_pmi gets broken with error:

Error in `colnames<-`(`*tmp*`, value = c("item1", "item2", "value")) : 
  attempt to set 'colnames' on an object with less than two dimensions

At this point the error message is pretty cryptic for me since log() function does not drop neither dimensions, nor attributes (names, colnames etc.) of objects, so it should have no impact whatsoever.

I'm posting the PR regardless of the error since it may possibly point at some problems with the package itself (sorry, I wasn't able to track it yet).