r-causal / causal-inference-in-R

Causal Inference in R: A book!
https://www.r-causal.org/
176 stars 45 forks source link

Can't `quarto preview` due to chapter 2 chunk #142

Closed tgerke closed 1 year ago

tgerke commented 1 year ago

The viz chunk at line 287 in chapter-2.qmd throws the following. I have the relevant packages installed and I'm stumped! Is this happening for you @LucyMcGowan @malcolmbarrett as well?

Quitting from lines 287-361 (chapter-02.qmd) 
Error:
! Can't combine `..1$fct_inorder(factor(set), ordered = TRUE)` <factor<b1c68>> and `..3$fct_inorder(factor(set), ordered = TRUE)` <ordered<>>.
Backtrace:
  1. global .main()
 51. ggplot2 (local) `<fn>`(`<vctrs__2>`)
 52. vctrs::vec_ptype2(x, y, x_arg = x_arg, y_arg = y_arg, call = call)
 53. vctrs (local) `<fn>`()
 54. vctrs:::vec_ptype2.factor.ordered(...)
malcolmbarrett commented 1 year ago

I think you need to update to the latest ggdag

malcolmbarrett commented 1 year ago

This should be fixed on main. The issue was that I copied some source code for a DAG in ch 2, which used the old code that does not work with the newest ggplot2. I suspect @LucyMcGowan either has an old version of ggplot2 or is working on a branch without that code

It's an easy fix for your branch, though. Remove ordered = TRUE from line 322 in ch2