Closed yuwen41200 closed 5 years ago
Thanks for reading, @yuwen41200! 🙌
The order of the terms isn't incorrect per se; it is as expected given the behavior of reorder()
. This issue does seem to have confused more than just you, however, as it is also the subject of #45.
We have previously discussed adding reorder_within()
to tidytext and there is a PR in juliasilge/tidytext#110; this would allow us to use that function in the book. Maybe we should go ahead and pull the trigger on that. @dgrtwo have you thought any more about this? I am now leaning toward including reorder_within()
in tidytext. (I know I told you a while back I didn't think it was the right spot for it.)
The PR in tidytext juliasilge/tidytext#110 has now been merged so I'll make some updates to the book once the new version of tidytext is on CRAN.
In Figure 5.3, the order of the term "-" is incorrect. I think this is because both document 1961-Kennedy and 2009-Obama have term "-", when calling
reorder(term, tf_idf)
, the function calculate the mean of the two tf-idf's.By the way, I got some questions when reading the book:
)
in "For instance, performingWebCorpus(GoogleFinanceSource("NASDAQ:MSFT")))
allows us [...]" is a typo?Thank you so much. I really like the book 😃