mdsr-book / mdsr2exercises

exercises for Modern Data Science with R
0 stars 2 forks source link

chicken-draw-room #14

Closed nicholasjhorton closed 3 years ago

nicholasjhorton commented 3 years ago

yields an error:

Error: Problem with`mutate()`input`age`.## x subscript out of bounds## i Input`age`is`map_dbl(coefs, pluck, 2)`
beanumber commented 3 years ago

I'm not seeing this one. The error suggests that when we go to pluck() from the coefficients, there is only one instead of two.

Could randomness be at fault? Are you still seeing a problem?

beanumber commented 3 years ago

I am able to compile all the solutions through foundations without getting tripped up on this exercise.

nicholasjhorton commented 3 years ago

How are you compiling? When I build the solutions, all I get is a subset (likely due to the following code if I'm parsing it correctly):

ex <- mdsr2exercises::mdsr_exercise_all()
chapters <- ex %>%
  select(chapter) %>%
  distinct()
to_compile <- chapters %>%
  # ethics is very slow to compile, but it works
#  filter(!grepl("ethics", chapter)) %>%
  # pick a specific chapter
  filter(grepl("data", chapter)) %>%
  pull(chapter)

print_solutions <- function(chap, hide = FALSE) {
  if (!hide & chap %in% to_compile) {
    mdsr2exercises::knit_mdsr_exercises_filter(
      chapter == chap, 
      show_answers = show_solutions
    )
  }
}
beanumber commented 3 years ago

Yeah, you just have to comment out all those filters to get what you want.