Open alex-gable opened 3 years ago
Thanks much - this is very helpful! Because we had to freeze R package versions many months ago when the production process started, there will be inevitable issues with package updates. For now, I added a section to the Preface indicating which versions of which packages we used for this edition of the textbook, but I will definitely make your suggested changes in the next edition (or in periodic code updates).
@alex-gable Can you make a PR with this?
@proback Can we merge this? I am not able to compile the book in PDF
@raffaem If you use the package versions listed in the preface are you able to compile the book?
@raffaem trying to be mindful/respectful of the fact that this is not my work, I've put the changes I've made in alex-gable/BeyondMLR@b96ab33. the content blocks you're looking for are in chapters 6, 9, 11 in that repo. What's relatively opaque amongst the changes, and only alluded to above, is the addition of new_session = TRUE
to render_book
in knit.R. The aforementioned change caused some of the above changes I recommended and made in my branch.
@proback want to double emphasize that I want to make sure I'm not breaking any rules in that branch (I've .gitignore
'd any bookdown outputs) and would love to contribute back anything I can. let me know if there's anything you'd like me to change
for comparison's sake, I've added my current packages as used in the project. renv
might be a super easy way to track these. I used it's dependencies
method to do project introspection and compile this list.
Once you make the changes above (and in Issue #12 ), it almost all works. Having a problem with the following at lines 518-28 in Chapter 11:
regressions <- refdata %>%
group_by(game) %>%
mutate(fit = list(glm(foul.home ~ foul.diff, family = binomial,
data = .)))
glm_info <- regressions %>%
summarise(tidy(fit)) %>%
ungroup() %>%
dplyr::select(game, term, estimate) %>%
spread(key = term, value = estimate) %>%
rename(rate = foul.diff, int = `(Intercept)`)
This causes the following error:
Error: Problem with `summarise()` input `..1`.
x No tidy method recognized for this list.
ℹ Input `..1` is `tidy(fit)`.
ℹ The error occurred in group 1: game = 1.
Major difference would seem to be some difference between lm()
and glm()
? Any other ideas? And how can we solve it?
OK, seemed to have solved it, in that the R code will compile. Just needed to follow the rewrite in gable's Chap 11 revs more precisely.
Still having problems with compile from Rmd to HTML/PDF. Throwing up hands for now and returning to this later.
I'm sorry for my silence - I've gotten pulled in several other directions over the past year. My new goal is to make a series of corrections and additions that I've been accumulating by the end of January 2023 (when I might actually have a small break to focus on this), possibly using quarto. Feel free to share any other suggestions you'd have before then.
Problem
Chapter 9 and 11 are failing to knit due to changes in dplyr(1.0) or broom(0.7)
I consulted this StackOverflow post for guidance (and provided my own solution) in order to solve the error which occurs in the below locations.
Example Solution
Looking at the documentation for
do()
, it appears to have been superseded with a recommendation to usenest_by()
. Conveniently, the documentation examples cover almost this exact use case (see details)