Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering book fails at scales-other.qmd #399

Open
py9mrg opened this issue Jul 10, 2024 · 2 comments
Open

Rendering book fails at scales-other.qmd #399

py9mrg opened this issue Jul 10, 2024 · 2 comments

Comments

@py9mrg
Copy link

py9mrg commented Jul 10, 2024

Hello,

When rendering the book (quarto render --to pdf) there is a failure in scales-other.qmd as per:

Error in `discrete_scale()`:
! formal argument "palette" matched by multiple actual arguments
Backtrace:
 1. ggplot2::scale_linetype(palette = linetypes)



Quitting from lines 259-266 [unnamed-chunk-18] (scales-other.qmd)
Execution halted

The offending lines are:

linetypes <- function(n) {
  types <- c("55",  "75", "95", "1115", "111115", "11111115",
             "5158", "9198", "c1c8")
  return(types[seq_len(n)])
}

base + scale_linetype(palette = linetypes)

I guess this is due to some of the changes in discrete_scale()?

Thanks.

@py9mrg
Copy link
Author

py9mrg commented Jul 10, 2024

Adding reference to tidyverse/ggplot2#5991

@teunbrand
Copy link

TL;DR from tidyverse/ggplot2#5991 (comment):
The book is wrong, scale_linetype() does not accept a palette argument, and only worked before by accident.

I'd recommend that the book uses scale_linetype_manual() to demonstrate the hexadecimal linetypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants